.erp-module-hub{margin:0 0 24px}.crm-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.crm-section-head h2,.crm-section-head h3{font-size:16px;line-height:24px;font-weight:600;margin:0;display:flex;align-items:center;gap:8px}.crm-section-head>span,.crm-section-head>a{font-size:12px;color:var(--muted)}.erp-modules{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.erp-module{display:flex;align-items:center;gap:12px;padding:18px 14px;background:var(--surface);border:1px solid var(--border);border-radius:12px;color:var(--text);min-width:0;text-decoration:none}.erp-module>.icon{width:20px;height:20px;flex-shrink:0;color:var(--muted)}.erp-module span:not(.crm-planned){min-width:0;flex:1}.erp-module strong{font-size:14px;white-space:nowrap}.erp-module small{display:block;font-size:12px;color:var(--muted);margin-top:4px;line-height:1.5}.erp-module>a{color:inherit}.erp-module.selected,.erp-module:first-child:hover{background:var(--selected);border-color:var(--control-border)}.erp-module.planned{background:var(--surface-soft)}.crm-planned{font-size:11px;color:var(--muted)}.erp-modules.compact{margin:0 0 24px}.erp-modules.compact .erp-module{padding:12px;gap:8px}.erp-modules.compact .erp-module strong{font-size:13px}.erp-legacy-heading{padding-top:20px;border-top:1px solid var(--border);margin-bottom:12px}.crm-page .page-title{margin-bottom:20px}.crm-nav{display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--border);padding-bottom:10px;margin-bottom:24px;overflow-x:auto}.crm-nav a{display:flex;align-items:center;gap:7px;padding:9px 11px;border-radius:8px;color:var(--muted);font-size:13px;white-space:nowrap;text-decoration:none}.crm-nav .icon{height:17px;width:17px}.crm-nav a:hover{background:var(--hover);color:var(--text)}.crm-nav a.active{color:var(--text);background:var(--selected);font-weight:600}.crm-nav .crm-erp-back{border-right:1px solid var(--border);border-radius:0;margin-right:5px;padding-left:0}.crm-overview-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.crm-overview-top h2{font-size:16px;font-weight:600}.crm-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.crm-metric{display:flex;flex-direction:column;gap:8px;padding:18px 20px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);text-decoration:none}.crm-metric:hover{background:var(--surface-soft)}.crm-metric>span{font-size:13px;color:var(--muted)}.crm-metric strong{font-size:24px;font-weight:600;letter-spacing:-.5px}.crm-metric small{font-size:12px;color:var(--muted)}.crm-overview-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px}.crm-block{background:var(--surface-soft);border-radius:14px;padding:20px;min-width:0}.crm-funnel{display:flex;flex-direction:column;gap:16px}.crm-funnel-row{display:grid;grid-template-columns:125px minmax(30px,1fr) 20px 75px;gap:12px;align-items:center;color:var(--text);text-decoration:none}.crm-funnel-row b{font-size:13px;font-weight:500}.crm-funnel-row small{color:var(--muted);text-align:right}.crm-bar{height:7px;border-radius:5px;background:var(--selected);overflow:hidden}.crm-bar i{display:block;height:100%;min-width:0;border-radius:5px;background:var(--chart-waiting)}.crm-funnel-row:nth-last-child(2) .crm-bar i{background:var(--chart-success)}.crm-status{display:inline-flex;align-items:center;white-space:nowrap;padding:4px 8px;font-size:12px;border-radius:6px;line-height:1.3;background:var(--selected);color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis}.crm-status.is-success{background:var(--success-bg);color:var(--success)}.crm-status.is-warm{background:var(--warning-bg);color:var(--warning)}.crm-status.is-muted{background:var(--selected);color:var(--muted)}.crm-attention{font-size:11px;background:var(--feedback-error-soft,#faefed);color:var(--feedback-error,#a4483d);border-radius:6px;padding:3px 6px;font-weight:500}.crm-followup,.crm-activity{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);min-height:64px}.crm-followup:last-child,.crm-activity:last-child{border:0;padding-bottom:0}.crm-followup>div,.crm-activity>div{min-width:0;flex:1}.crm-followup small,.crm-activity small{display:block;color:var(--muted);font-size:12px;margin-top:5px}.crm-followup .icon-btn{width:26px;height:26px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.crm-activity-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:var(--surface);color:var(--muted)}.crm-activity-icon .icon{width:16px;height:16px}.crm-source-list>div{display:grid;grid-template-columns:100px 1fr 20px;gap:15px;align-items:center;margin:17px 0;font-size:13px}.crm-source-list b{font-weight:500}.crm-source-list .crm-bar i{background:var(--chart)}.crm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.crm-search{max-width:340px;flex:1;min-width:180px}.crm-toolbar-actions{display:flex;align-items:center;gap:8px}.crm-toolbar .btn,.crm-toolbar select,.crm-search{height:36px}.crm-toolbar select{max-width:170px}.crm-toolbar .icon-btn{border:1px solid var(--border);height:36px;width:36px;border-radius:9px}.crm-filter-dot{width:6px;height:6px;border-radius:50%;background:var(--text)}.crm-saved-views{display:flex;gap:6px;overflow-x:auto;margin-bottom:12px}.crm-saved-views button{padding:6px 10px;white-space:nowrap;border-radius:6px;color:var(--muted);font-size:12px}.crm-saved-views button.active{background:var(--selected);color:var(--text)}.crm-table-scroll{overflow:auto;border:1px solid var(--border);border-radius:10px;background:var(--surface)}.crm-table{width:100%;border-collapse:collapse;table-layout:auto;min-width:780px;font-size:13px}.crm-table th{height:42px;background:var(--surface-soft);font-size:12px;color:var(--muted);font-weight:500;text-align:left;border-bottom:1px solid var(--border)}.crm-table th button{display:flex;align-items:center;gap:5px;white-space:nowrap;color:inherit;text-align:left}.crm-table td,.crm-table th{padding:10px 14px;max-width:250px}.crm-table td{border-bottom:1px solid var(--border);height:58px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crm-table tr:last-child td{border:0}.crm-table tr:hover td{background:var(--surface-soft)}.crm-table tr.selected td{background:var(--selected)}.crm-table .crm-select-cell{width:36px;padding-right:0}.crm-table td:first-child:has(input){padding-right:0}.crm-table input[type=checkbox],.crm-column-options input{width:15px;height:15px;accent-color:var(--primary);vertical-align:middle}.crm-table .crm-row-action{width:40px}.crm-table .icon-btn{width:28px;height:28px}.crm-record-link{font-weight:600;color:var(--text);text-align:left;font-size:13px;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-record-link:hover,.crm-inline-link:hover{text-decoration:underline}.crm-inline-link{font-size:13px;text-align:left;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-owner{display:inline-flex;align-items:center;gap:7px;font-size:12px}.crm-avatar{display:inline-grid;place-items:center;flex-shrink:0;width:24px;height:24px;background:var(--selected);border:1px solid var(--border);border-radius:50%;font-size:10px;color:var(--muted);vertical-align:middle}.crm-pagination{display:flex;align-items:center;justify-content:space-between;padding:15px 1px;color:var(--muted);font-size:12px;gap:16px}.crm-pagination>div{display:flex;align-items:center;gap:12px}.crm-pagination .btn{height:30px;font-size:12px;padding:0 10px}.crm-bulk{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:10px 14px;border-radius:9px;background:var(--surface-soft);margin-bottom:12px;font-size:13px}.crm-archive-notice{padding:12px 14px;border-radius:9px;background:var(--warning-bg);color:var(--warning);margin-bottom:12px;font-size:13px}.crm-board{display:flex;gap:14px;overflow-x:auto;padding-bottom:12px;min-height:420px;align-items:stretch}.crm-column{flex:0 0 258px;background:var(--surface-soft);border:1px solid transparent;border-radius:12px;padding:14px;min-height:400px}.crm-column.drag-over{border-color:var(--primary);background:var(--selected)}.crm-column>header{display:flex;align-items:center;justify-content:space-between;margin:0 0 16px}.crm-column h3{font-size:13px;font-weight:600}.crm-column .count{font-size:11px}.crm-column-cards{display:flex;flex-direction:column;gap:12px}.crm-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:13px;cursor:grab}.crm-card:active{cursor:grabbing}.crm-card-heading{display:flex;align-items:flex-start;gap:5px}.crm-card-heading .crm-record-link{flex:1;white-space:normal}.crm-card-heading .icon-btn{width:20px;height:20px}.crm-card>p{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-card-value{font-size:15px;font-weight:600;margin:15px 0}.crm-card-value small{font-size:11px;color:var(--muted);font-weight:400;display:block;margin-top:5px}.crm-card footer{display:flex;align-items:center;gap:7px;margin-top:16px}.crm-card footer>small{font-size:11px;color:var(--muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-card .crm-stage-select{width:29px;min-width:29px;height:28px;color:transparent;padding:0;font-size:0;background-position:center;border-color:transparent;background-color:transparent;cursor:pointer}.crm-card .crm-stage-select option{color:var(--text);font-size:13px}.crm-column-empty{font-size:12px;color:var(--muted);text-align:center;padding-top:35px}.crm-group{margin-bottom:20px}.crm-group>h3{display:flex;align-items:center;gap:10px;font-size:13px;margin:0 0 10px}.crm-empty{padding:55px 20px;background:var(--surface-soft);text-align:center;border-radius:12px}.crm-empty>.icon{width:24px;height:24px;color:var(--muted)}.crm-empty h3{font-size:16px;margin:12px 0 7px}.crm-empty p{font-size:13px;color:var(--muted);margin-bottom:16px}.crm-empty .btn{display:inline-flex;margin:4px}.crm-mode-note{font-size:12px;color:var(--muted);margin:18px 0}.crm-no-data{font-size:13px;color:var(--muted);padding:24px 0}.crm-detail-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.crm-detail-actions>div{display:flex;align-items:center;gap:8px}.crm-record-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}.crm-detail-main{padding:0;overflow:hidden;min-height:400px}.crm-detail-tabs{display:flex;gap:4px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border);overflow-x:auto}.crm-detail-tabs button{font-size:13px;white-space:nowrap;border-radius:7px;padding:8px 11px;color:var(--muted)}.crm-detail-tabs button[aria-selected=true]{background:var(--selected);color:var(--text);font-weight:600}.crm-detail-tabs span{font-weight:400;margin-left:4px;font-size:11px}.crm-detail-body{padding:22px}.crm-record-sidebar{display:flex;flex-direction:column;gap:18px}.crm-summary-fields>div{margin:17px 0}.crm-summary-fields dt{font-size:12px;color:var(--muted);margin-bottom:6px}.crm-summary-fields dd{font-size:13px;display:flex;align-items:center;gap:6px;margin:0;overflow-wrap:anywhere}.crm-record-description{font-size:13px;line-height:1.6;border-top:1px solid var(--border);padding-top:15px;color:var(--muted);white-space:pre-wrap}.crm-detail-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.crm-detail-fields dt{font-size:12px;color:var(--muted);margin-bottom:7px}.crm-detail-fields dd{font-size:13px;line-height:1.6;margin:0;overflow-wrap:anywhere;white-space:pre-wrap}.crm-timeline>div{display:flex;gap:14px;position:relative;padding:0 0 25px}.crm-timeline>div:not(:last-child):before{content:'';position:absolute;top:25px;bottom:0;left:12px;width:1px;background:var(--border)}.crm-timeline-mark{display:grid;place-items:center;width:25px;height:25px;flex-shrink:0;background:var(--surface);border:1px solid var(--border);border-radius:50%;color:var(--muted);z-index:1}.crm-timeline-mark .icon{height:13px;width:13px}.crm-timeline strong{font-size:13px;font-weight:500}.crm-timeline p{font-size:12px;color:var(--muted);margin-top:7px}.crm-related-item{padding:15px 0;border-bottom:1px solid var(--border)}.crm-related-item>div,.crm-related-deal{display:flex;align-items:center;justify-content:space-between;gap:10px}.crm-related-item p{font-size:13px;color:var(--muted);line-height:1.6;white-space:pre-wrap;margin-top:12px}.crm-related-item small,.crm-related-deal small{font-size:12px;color:var(--muted)}.crm-related-deal{padding:10px 0}.crm-deal-amount{font-size:24px;margin:15px 0 20px;font-weight:600}.crm-deal-amount small{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:6px}.crm-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.crm-form-grid .field{min-width:0}.crm-form-wide{grid-column:1/-1}.crm-form-hint{font-size:13px;color:var(--muted);line-height:1.6;margin-bottom:20px}.crm-form-grid textarea{resize:vertical;min-height:90px}.crm-form-error{font-size:13px;line-height:1.6;border-radius:9px;padding:12px;margin:15px 0;background:var(--feedback-error-soft,#faefed);color:var(--feedback-error,#a4483d)}.crm-form-error[hidden]{display:none}.crm-column-options{display:grid;grid-template-columns:repeat(2,1fr);gap:15px}.crm-column-options label{display:flex;align-items:center;gap:8px;font-size:13px}.crm-action-list{display:flex;flex-direction:column;gap:8px}.crm-action-list .btn{justify-content:flex-start;border-color:transparent;background:var(--surface-soft)}#crm-import-preview{font-size:13px;background:var(--surface-soft);border-radius:8px;margin-top:14px;padding:14px}#crm-import-preview:empty{display:none}#crm-import-preview ul{margin:10px 0 0 20px;line-height:1.8}.crm-page button:focus-visible,.crm-page a:focus-visible{outline:2px solid var(--primary);outline-offset:2px}.crm-page .btn:disabled{opacity:.45;cursor:default}.crm-workbench input[type=checkbox]{appearance:auto;padding:0;min-height:0}.crm-page .page-footer{margin-top:28px}
@media(min-width:1500px){.crm-column{flex-basis:280px}.crm-table td{height:62px}}
@media(max-width:1150px){.erp-modules{grid-template-columns:repeat(3,minmax(0,1fr))}.erp-modules.compact .erp-module .icon:last-child{display:none}.crm-overview-grid{grid-template-columns:1fr}.crm-record-layout{grid-template-columns:minmax(0,1fr) 260px}.crm-toolbar{flex-wrap:wrap}.crm-search{max-width:none}.crm-funnel-row{grid-template-columns:135px 1fr 30px 100px}.crm-metric{padding:16px}.crm-metric strong{font-size:22px}}
@media(max-width:760px){.erp-modules{grid-template-columns:repeat(2,minmax(0,1fr))}.erp-modules.compact{display:flex;overflow-x:auto}.erp-modules.compact .erp-module{min-width:155px}.crm-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.crm-record-layout{grid-template-columns:1fr}.crm-record-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.crm-toolbar-actions{flex:1;flex-wrap:wrap}.crm-toolbar-actions select{flex:1;min-width:100px}.crm-search{flex-basis:100%}.crm-funnel-row{grid-template-columns:115px 1fr 20px 70px;gap:8px}.crm-block{padding:16px}.crm-detail-main{padding:0}.crm-detail-actions{align-items:flex-start;flex-wrap:wrap}.crm-detail-actions>div{flex-wrap:wrap}.crm-pagination{flex-wrap:wrap}.crm-pagination>div{gap:8px}.crm-form-grid{grid-template-columns:1fr}.crm-form-wide{grid-column:auto}.crm-nav{margin-bottom:16px}.crm-section-head>span{display:none}}
@media(max-width:480px){.crm-record-sidebar{grid-template-columns:1fr}.crm-metric strong{font-size:20px}.crm-metric small{font-size:11px}.erp-module .crm-planned{display:none}.crm-detail-fields{grid-template-columns:1fr}.crm-funnel-row{grid-template-columns:105px 1fr 15px 66px}.crm-block{padding:14px}.crm-detail-main{padding:0}.crm-followup{gap:8px}.crm-followup .crm-status{font-size:11px}.crm-record-link{white-space:normal}.crm-table .crm-record-link{white-space:nowrap}}
/* Keep reserved module labels readable in the compact ERP switcher. */
.erp-module strong{display:block;overflow:hidden;text-overflow:ellipsis}.crm-planned{flex-shrink:0;white-space:nowrap}.erp-modules.compact .erp-module:nth-child(n+4) .crm-planned{display:none}
@media(min-width:761px) and (max-width:1400px){.erp-module-hub .erp-modules{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* ERP products live beside the primary navigation, outside page content. */
.workspace.has-erp-products{display:grid;grid-template-columns:176px minmax(0,1fr);align-items:start}
.has-erp-products #main{min-width:0}
.erp-product-rail{position:sticky;top:0;height:100dvh;overflow-y:auto;overscroll-behavior:contain;border-right:1px solid var(--border);background:var(--surface-soft);padding:26px 10px;min-width:0}
.erp-product-heading{padding:0 10px 22px;display:flex;align-items:baseline;gap:8px}
.erp-product-heading>span{font-size:16px;font-weight:600;color:var(--text)}
.erp-product-heading>small{font-size:12px;color:var(--muted)}
.erp-product-rail nav{display:flex;flex-direction:column;gap:5px}
.erp-product-item{display:flex;align-items:center;gap:9px;min-height:38px;width:100%;padding:8px 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);text-decoration:none;font-size:13px;text-align:left;white-space:nowrap}
.erp-product-item>.icon{width:18px;height:18px;flex:none}
.erp-product-item>span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis}
.erp-product-item.active{background:var(--selected);color:var(--text);font-weight:600}
.erp-product-item:not(:disabled):hover{background:var(--hover);color:var(--text)}
.erp-product-item:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.erp-product-item:disabled{cursor:default;color:var(--muted);opacity:.65}
.erp-product-item small{font-size:11px;font-weight:400;flex:none}
.erp-product-divider{height:1px;background:var(--border);margin:12px 10px}
.erp-product-mobile{display:none}
@media(max-width:800px){
 .workspace.has-erp-products{display:block}
 .erp-product-rail{display:none}
 .erp-product-mobile{display:flex;align-items:center;gap:12px;padding:12px 17px;border-bottom:1px solid var(--border);background:var(--surface-soft)}
 .erp-product-mobile label{font-size:12px;color:var(--muted);white-space:nowrap}
 .erp-product-mobile select{height:36px;min-width:0;flex:1;font-size:13px}
}

/* Leads share the merchant pipeline's visible view switch and compact cards. */
.crm-leads-workbench .erp-pipeline-head{justify-content:space-between}
.crm-leads-workbench .erp-pipeline-head>.row{flex-wrap:wrap}
.crm-leads-workbench .crm-toolbar{flex-wrap:wrap}
.crm-leads-workbench .crm-toolbar-actions{margin-left:auto}
.crm-view-hint{font-size:12px;color:var(--muted)}
.crm-lead-status-tabs{gap:18px}
.crm-lead-board{scrollbar-width:thin;scrollbar-color:var(--control-border) transparent;min-height:460px}
.crm-lead-board .crm-column{flex:0 0 258px;background:var(--surface);border-color:var(--border)}
.crm-lead-board .crm-column>header{justify-content:flex-start;gap:8px;margin-bottom:14px}
.crm-lead-board .crm-column h3{font-size:14px;font-weight:500}
.crm-lead-board .crm-column>header>.icon-btn{margin-left:auto;width:26px;height:26px}
.crm-lead-board .crm-column>header .pill{font-size:12px;padding:1px 7px;background:var(--selected);color:var(--muted)}
.crm-stage-dot{width:8px;height:8px;border:2px solid var(--muted);border-radius:50%;flex:none}
.crm-stage-dot.is-warm{border-color:var(--chart-waiting)}
.crm-stage-dot.is-success{border-color:var(--chart-success)}
.crm-lead-board .crm-card{background:var(--surface-soft);padding:12px;min-width:0}
.crm-lead-board .crm-card:not([draggable=true]){cursor:default}
.crm-lead-board .crm-card-heading{align-items:center;gap:6px}
.crm-lead-board .crm-record-link{min-width:0;font-size:14px;white-space:nowrap;font-weight:500}
.crm-lead-board .crm-card-heading>.icon-btn{width:24px;height:24px;flex:none}
.crm-lead-owner{display:flex;align-items:center;gap:7px;margin-top:14px;font-size:12px;color:var(--muted)}
.crm-lead-owner>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-lead-source{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:14px;font-size:12px;color:var(--muted)}
.crm-lead-source>span:last-child{color:var(--text)}
.crm-lead-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:14px;padding-top:10px;border-top:1px solid var(--border);font-size:12px}
.crm-lead-bottom select{min-width:0;width:116px;height:30px;padding:4px 24px 4px 6px;background-color:transparent;border-color:transparent;font-size:12px;background-position:right 6px center}
.crm-lead-bottom select:hover{background-color:var(--hover)}
.crm-lead-bottom small{color:var(--muted);font-size:12px;white-space:nowrap}
.crm-lead-board .crm-column-cards{min-height:340px}
.crm-lead-board .crm-column-empty{display:flex;flex-direction:column;gap:8px;padding:40px 0;font-size:13px}
.crm-lead-board .crm-column-empty small{font-size:12px}
.crm-lead-board .crm-column.drag-over{background:var(--selected);border-color:var(--focus-ring)}
.crm-card.is-dragging{opacity:.45}
@media(max-width:650px){.crm-leads-workbench .crm-toolbar-actions{width:100%}.crm-leads-workbench .crm-toolbar-actions>.icon-btn{margin-left:auto}.crm-view-hint{flex:1}.crm-lead-board{min-height:400px}}

/* CRM relationships, permissions and compact title view chooser. */
.crm-page .contextual-title-row{flex-wrap:wrap;column-gap:10px;row-gap:8px}
.crm-view-menu{position:relative;z-index:7;font-size:14px;font-weight:400}
.crm-view-menu>summary{list-style:none;display:flex;align-items:center;gap:10px;cursor:pointer;color:var(--muted)}
.crm-view-menu>summary::-webkit-details-marker{display:none}
.crm-view-slash{color:var(--muted);font-size:18px;font-weight:400}
.crm-view-trigger{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:9px;font-size:14px;background:var(--surface-soft);color:var(--text)}
.crm-view-trigger>.icon{width:16px;height:16px}.crm-view-trigger>.icon:last-child{width:12px;height:12px;color:var(--muted)}
.crm-view-menu[open] .crm-view-trigger,.crm-view-trigger:hover{background:var(--selected)}
.crm-view-menu[open] .crm-view-trigger>.icon:last-child{transform:rotate(180deg)}
.crm-view-popover{position:absolute;left:16px;top:calc(100% + 8px);min-width:195px;padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px #00000016}
.crm-view-popover button{display:flex;align-items:center;gap:10px;border-radius:8px;padding:10px 12px;width:100%;font-size:14px;text-align:left}
.crm-view-popover button>span{flex:1}.crm-view-popover .icon{width:16px;height:16px}.crm-view-popover button[aria-pressed=true]{background:var(--selected)}.crm-view-popover button:hover{background:var(--hover)}
.crm-access-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:-8px 0 18px;font-size:12px;color:var(--muted)}
.crm-scope-group,.crm-access-controls,.crm-preview-person,.crm-group-control{display:flex;align-items:center;gap:8px;min-width:0}
.crm-scope-group>.icon,.crm-group-control>.icon{width:16px;height:16px;flex-shrink:0}
.crm-access-bar select{height:32px;font-size:12px;max-width:240px;background-color:var(--surface);border-color:var(--border)}
.crm-access-bar .btn{height:32px;font-size:12px}.crm-preview-person>span{white-space:nowrap}
.crm-group-control{height:36px;font-size:12px;color:var(--muted);white-space:nowrap}.crm-group-control select{min-width:96px;max-width:125px;font-size:13px;background-color:var(--surface);color:var(--text)}
.crm-leads-workbench>.crm-lead-status-tabs{margin-bottom:16px}.crm-board-status{margin-top:10px}.crm-group h3{font-weight:600}
.crm-owner-static{display:flex;gap:8px;align-items:center;min-height:38px;padding:7px 10px;background:var(--surface-soft);border-radius:9px;font-size:13px}.crm-owner-static small{margin-left:auto;color:var(--muted);font-weight:400}
.crm-relationship-forms{margin:12px 0 20px}.crm-related-editor{border:1px solid var(--border);border-radius:10px;margin-top:10px;overflow:hidden;background:var(--surface)}
.crm-related-editor>summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;padding:13px 14px;font-size:13px;font-weight:500;background:var(--surface-soft)}
.crm-related-editor>summary::-webkit-details-marker{display:none}.crm-related-editor>summary>.icon{width:17px;height:17px}.crm-related-editor>summary>.icon:last-child{margin-left:auto;width:12px;height:12px}.crm-related-editor[open]>summary>.icon:last-child{transform:rotate(180deg)}
.crm-related-editor .crm-form-grid{padding:16px;margin:0}
.crm-access-intro{display:flex;gap:12px;padding:16px;background:var(--surface-soft);border-radius:12px;margin-bottom:20px}.crm-access-intro>.icon{width:20px;height:20px;flex-shrink:0;margin-top:2px}.crm-access-intro strong{font-size:14px;font-weight:600}.crm-access-intro p,.crm-rules p{font-size:13px;line-height:1.6;color:var(--muted);margin-top:6px}
.crm-share-list{margin-top:24px}.crm-share-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}.crm-share-row>span{display:flex;align-items:center;gap:10px;font-size:13px}.crm-share-row small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.crm-share-row select{height:36px;width:132px;font-size:13px}
.crm-contact-role{display:grid;grid-template-columns:minmax(120px,1fr) 155px 84px;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border)}.crm-contact-choice,.crm-primary-choice{display:flex;align-items:center;gap:9px;font-size:13px}.crm-contact-choice>span{min-width:0}.crm-contact-choice strong{display:block;font-size:14px;font-weight:500}.crm-contact-choice small{display:block;color:var(--muted);font-size:12px;overflow-wrap:anywhere;margin-top:5px}.crm-contact-role select{height:36px;font-size:13px}.crm-contact-role input[type=checkbox],.crm-contact-role input[type=radio]{height:16px;width:16px;flex-shrink:0;accent-color:var(--primary)}
.crm-rules{display:flex;flex-direction:column;gap:20px}.crm-rules h3{font-size:15px;margin:0}.crm-rules>.btn{align-self:flex-start}.crm-restricted{color:var(--muted);font-size:12px}
@media(max-width:760px){.crm-access-controls{flex-wrap:wrap}.crm-access-bar{margin-top:0}.crm-preview-person select{max-width:190px}.crm-group-control>span{display:none}.crm-contact-role{grid-template-columns:1fr 130px}.crm-primary-choice{grid-column:1 / -1}.crm-access-controls>.btn{margin-left:auto}}
@media(prefers-reduced-motion:no-preference){.crm-view-menu[open] .crm-view-popover{animation:crm-menu-in 120ms ease-out}@keyframes crm-menu-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}

/* Clickable record surfaces keep nested controls independent. */
.crm-table tbody tr[data-crm-open],.crm-page .crm-card[data-crm-open]{cursor:pointer}
.crm-table tbody tr[data-crm-open]:hover td{background:var(--hover)}
.crm-page .crm-card[data-crm-open]:hover{border-color:var(--control-border);box-shadow:0 0 0 1px var(--border)}
.crm-page [data-crm-open]:focus-visible{outline:2px solid var(--focus-ring,var(--primary));outline-offset:-2px}
.crm-page .crm-card[data-crm-open]:focus-visible{outline-offset:2px}
.crm-page .crm-card[draggable=true] .erp-drag-handle{cursor:grab}
.crm-page .crm-card.is-dragging{cursor:grabbing}

/* Group By uses one aligned table header and collapsible row groups. */
.crm-group-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;font-size:12px;color:var(--muted)}
.crm-group-summary>div{display:flex;gap:4px}
.crm-group-summary .btn{height:30px;padding:0 9px;font-size:12px}
.crm-group-table .crm-group-heading th{padding:0;height:auto;background:var(--surface-soft);border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.crm-group-table .crm-group-heading button{display:flex;align-items:center;gap:9px;width:100%;padding:13px 14px;font-size:13px;font-weight:500;color:var(--text)}
.crm-group-table .crm-group-heading button:hover{background:var(--hover)}
.crm-group-heading .icon{width:16px;height:16px;transition:transform 160ms ease}
.crm-group-heading [aria-expanded=false]>.icon{transform:rotate(-90deg)}
.crm-group-heading .count{font-size:11px;font-weight:500}
.crm-group-table tbody[hidden]{display:none}
.crm-group-table tbody tr:last-child td{border-bottom:1px solid var(--border)}
@media(max-width:600px){.crm-group-summary{align-items:flex-start;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.crm-group-heading .icon{transition:none}}

/* Overview uses the same record snapshot and filters as the CRM modules. */
.crm-metric{width:100%;text-align:left;color:var(--text)}
.crm-overview-top{gap:16px;flex-wrap:wrap}.crm-overview-caption{font-size:12px;color:var(--muted);margin-top:6px}
.crm-overview-controls{display:flex;gap:10px;align-items:center}.crm-overview-controls label{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted)}.crm-overview-controls select{width:86px;height:34px;min-height:34px}
.crm-overview-links{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0 24px}.crm-overview-links>button{display:flex;gap:8px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:10px;font-size:12px;text-align:left;color:var(--muted);min-width:0}.crm-overview-links strong{color:var(--text);margin-left:auto}.crm-overview-links .icon{height:16px;width:16px;flex-shrink:0}.crm-overview-links>button:hover,.crm-contract-counts>button:hover{background:var(--surface-soft)}
.crm-overview-link{display:flex;gap:5px;align-items:center;font-size:12px;color:var(--muted);white-space:nowrap}.crm-overview-link .icon{height:14px;width:14px}.crm-overview-link:hover{text-decoration:underline}.crm-section-head h2>small{font-size:11px;font-weight:400;color:var(--muted);margin-left:6px}.crm-funnel-row{width:100%;text-align:left;color:var(--text);border-radius:6px}.crm-funnel-row:hover{background:var(--selected)}
.crm-source-list>button{display:grid;grid-template-columns:100px 1fr 24px;gap:15px;align-items:center;width:100%;padding:8px 0;margin:1px 0;font-size:13px;text-align:left;color:var(--text);border-radius:6px}.crm-source-list>button:hover{background:var(--selected)}.crm-source-list b{text-align:right}
.crm-contract-overview{margin-top:20px}.crm-contract-counts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.crm-contract-counts>button{display:flex;align-items:center;gap:12px;font-size:13px;text-align:left;padding:12px;border:1px solid var(--border);border-radius:8px;color:var(--muted)}.crm-contract-counts strong{margin-left:auto;color:var(--text)}.crm-contract-counts .icon{width:15px;height:15px}
.crm-overview-filter{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 12px;margin-bottom:12px;border-radius:8px;background:var(--surface-soft);color:var(--muted);font-size:12px}.crm-overview-filter>span{display:flex;align-items:center;gap:7px}.crm-overview-filter .icon{height:14px;width:14px}
@media(max-width:760px){.crm-overview-links{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-contract-counts{grid-template-columns:1fr}.crm-overview-controls{width:100%;justify-content:space-between}}

/* Compact relationship form: independent modes, searchable pickers, fixed shared dialog chrome. */
.crm-relation-switches{display:flex;gap:28px;flex-wrap:wrap;margin:0 0 24px}.crm-relation-switch{position:relative;display:inline-flex;align-items:center;gap:12px;font-size:13px;color:var(--muted);cursor:pointer;min-height:32px}.crm-relation-switch input{position:absolute;right:0;width:36px;height:22px;opacity:0;margin:0;cursor:pointer}.crm-relation-switch i{width:36px;height:22px;border-radius:20px;background:var(--selected);border:1px solid var(--control-border,var(--border));position:relative;pointer-events:none;flex-shrink:0}.crm-relation-switch i:after{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:var(--muted);transition:transform .16s ease}.crm-relation-switch input:checked+i{background:var(--primary);border-color:var(--primary)}.crm-relation-switch input:checked+i:after{transform:translateX(14px);background:var(--on-primary,var(--surface))}.crm-relation-switch input:focus-visible+i{outline:2px solid var(--text);outline-offset:3px}
.crm-relation-section{border-bottom:1px solid var(--border);padding:0 0 20px;margin:0 0 20px}.crm-relation-section h3{font-size:14px;font-weight:600;display:flex;gap:8px;align-items:center;margin:0 0 16px}.crm-relation-section h3 .icon{width:17px;height:17px;color:var(--muted)}.crm-relation-section fieldset{border:0;padding:0;margin:0;min-width:0}.crm-relation-section fieldset[hidden]{display:none}.crm-relation-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px}.crm-relation-section .field{margin-bottom:16px}.crm-relation-section .field textarea{min-height:72px}.crm-relation-section .field:last-child{margin-bottom:0}.crm-relation-business{border-bottom:0;padding-bottom:0}.crm-relation-note,.crm-relation-preview,.crm-relation-notice{font-size:12px;color:var(--muted);line-height:1.6;margin:10px 0 0;overflow-wrap:anywhere}.crm-relation-notice:empty{display:none}.crm-relation-notice:not(:empty){padding:10px 12px;border-radius:8px;background:var(--warning-bg);color:var(--warning)}
.crm-relation-picker{position:relative;max-width:calc(50% - 8px)}.crm-relation-picker>label{display:block;font-size:13px;margin-bottom:8px;color:var(--text)}.crm-picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:40px;padding:8px 12px;border:1px solid var(--control-border,var(--border));border-radius:9px;background:var(--surface);font-size:14px;text-align:left;color:var(--text)}.crm-picker-trigger>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-picker-trigger .icon{width:16px;height:16px;color:var(--muted);flex-shrink:0}.crm-picker-trigger[aria-expanded=true]{outline:2px solid var(--selected);border-color:var(--muted)}.crm-picker-popover{position:absolute;left:0;right:0;top:100%;margin-top:6px;min-width:240px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px #0002;padding:8px;z-index:15}.crm-picker-popover[hidden]{display:none}.crm-picker-search{display:flex;align-items:center;gap:8px;border:1px solid var(--control-border,var(--border));border-radius:8px;padding:0 8px}.crm-picker-search .icon{width:16px;height:16px;color:var(--muted)}.crm-picker-search input{border:0;background:transparent;box-shadow:none;outline:none!important;min-width:0;width:100%;height:36px;padding:6px 0;font-size:13px}.crm-picker-options{max-height:180px;overflow:auto;overscroll-behavior:contain;margin:8px 0}.crm-picker-options>button{display:flex;flex-direction:column;gap:2px;width:100%;border-radius:7px;text-align:left;padding:9px 10px;font-size:13px;color:var(--text);overflow-wrap:anywhere}.crm-picker-options>button small{font-size:12px;color:var(--muted)}.crm-picker-options>button:hover,.crm-picker-options>button:focus-visible,.crm-picker-options>button[aria-selected=true]{background:var(--selected)}.crm-picker-actions{border-top:1px solid var(--border);padding-top:6px}.crm-picker-actions>button{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:7px;width:100%;font-size:13px;color:var(--text)}.crm-picker-actions>button .icon{width:16px;height:16px}.crm-picker-actions>button:hover{background:var(--surface-soft)}.crm-picker-empty{padding:12px;font-size:12px;color:var(--muted)}
@media(max-width:700px){.crm-relation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-relation-picker{max-width:100%}.crm-relation-switches{gap:8px 20px}.crm-relation-switch{font-size:12px}}
@media(max-width:480px){.crm-relation-grid{grid-template-columns:1fr}.crm-relation-switches{display:grid;grid-template-columns:1fr}.crm-relation-switch{justify-content:space-between;font-size:13px}.crm-picker-popover{min-width:0}}
@media(prefers-reduced-motion:reduce){.crm-relation-switch i:after{transition:none}}

.crm-field-label{display:block}.crm-required{color:var(--feedback-error,#a4483d)}.crm-field-error{display:block;color:var(--feedback-error,#a4483d);font-size:12px;line-height:1.5;margin-top:5px;font-weight:400}.crm-relation-section [aria-invalid=true]{border-color:var(--feedback-error,#a4483d)!important;outline-color:var(--feedback-error,#a4483d)}

.crm-field-toolbar{align-items:start;gap:12px}.crm-field-search{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:8px;flex:1;min-width:0}.crm-field-search input,.crm-field-search select{width:100%;max-width:none;min-width:0;height:36px;padding:7px 10px;font-size:13px;background-color:var(--surface-soft);border:1px solid var(--border);border-radius:8px}.crm-field-search select{padding-right:28px}.crm-field-toolbar .crm-toolbar-actions{flex-shrink:0}.crm-field-search:has(input#crm-search-name):not(:has(input#crm-search-email)):not(:has(input#crm-search-contract_number)){grid-template-columns:repeat(4,minmax(110px,1fr))}@media(max-width:1350px){.crm-field-search{flex-basis:100%}.crm-field-toolbar .crm-toolbar-actions{margin-left:auto}}@media(max-width:760px){.crm-field-search,.crm-field-search:has(input#crm-search-name):not(:has(input#crm-search-email)):not(:has(input#crm-search-contract_number)){grid-template-columns:repeat(2,minmax(0,1fr))}.crm-field-search input,.crm-field-search select{height:40px}}

/* CRM import: one shared workspace-aware wizard, with a fixed dialog header/footer. */
.crm-import-steps{display:flex;gap:12px;list-style:none;margin:0 0 28px;padding:0}.crm-import-steps li{flex:1;min-width:0;color:var(--muted)}.crm-import-steps i{display:block;height:4px;background:var(--border);border-radius:4px;margin-top:12px}.crm-import-steps .current{color:var(--text);font-weight:600}.crm-import-steps .current i,.crm-import-steps .done i{background:var(--text)}
.crm-import-content h3{margin:0 0 12px}.crm-import-type{max-width:420px}.crm-import-upload{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;border:1px dashed var(--border);border-radius:16px;padding:28px;background:var(--surface);cursor:pointer}.crm-import-upload:hover{background:var(--hover)}.crm-import-upload:focus-within{outline:2px solid var(--text);outline-offset:2px}.crm-import-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.crm-import-upload span,.crm-import-busy{color:var(--muted);font-size:13px}.crm-import-content .crm-section-head{margin-top:24px}.crm-import-content .crm-section-head p{font-weight:400;color:var(--muted)}
.crm-import-table{overflow:auto;max-height:410px;border:1px solid var(--border);border-radius:12px;margin:16px 0;overscroll-behavior:contain}.crm-import-table table{border-collapse:collapse;width:100%;font-size:14px}.crm-import-table th,.crm-import-table td{padding:12px 16px;text-align:left;border-bottom:1px solid var(--border);max-width:320px;overflow:hidden;text-overflow:ellipsis}.crm-import-table th{background:var(--surface);position:sticky;top:0;z-index:1;white-space:nowrap}.crm-import-table th label{display:grid;gap:8px}.crm-import-table select{min-width:180px}.crm-import-table td{min-width:80px}.crm-import-table td.crm-import-ignored{color:var(--muted);background:var(--surface)}
.crm-import-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:12px;margin:0 0 24px}.crm-import-stats>div{border:1px solid var(--border);border-radius:12px;padding:16px}.crm-import-stats span{display:block;font-size:13px;color:var(--muted)}.crm-import-stats strong{display:block;font-size:22px;margin-top:6px}.crm-import-tabs{display:flex;gap:6px;flex-wrap:wrap}.crm-import-tabs .selected{background:var(--hover)}.crm-import-busy{margin-right:auto}
@media(max-width:600px){.crm-import-steps{gap:8px;font-size:12px}.crm-import-stats{grid-template-columns:repeat(2,1fr)}}
