/* CRM-only density and workspace refinement. No business-state selectors are changed. */
.asfit-v2 .cv2 { --crm-section-gap:16px; gap:var(--crm-section-gap); }
.asfit-v2 .cv2 > :is(.proposal-page,.quote-page) { gap:var(--crm-section-gap); }
.asfit-v2 .cv2 .page-header-row { gap:12px; }
.asfit-v2 .cv2 .cv2-column { gap:16px; }
.asfit-v2 .cv2 .cv2-toolbar { margin-bottom:4px; gap:10px; }
.asfit-v2 .cv2 .cv2-register .asfit-card-header { padding:14px 18px; }
.asfit-v2 .cv2 .asfit-table :is(td,th) { padding:12px 14px; vertical-align:top; }
.asfit-v2 .cv2 .cv2-inspection { gap:12px; padding:18px; }
.asfit-v2 .cv2 .cv2-source-meta { gap:12px; padding:12px; }
.asfit-v2 .cv2 .cv2-document-section { padding:16px 0; }
.asfit-v2 .cv2 .proposal-prose { line-height:1.7; }
.asfit-v2 .cv2 .document-sharing { gap:16px; }
.asfit-v2 .cv2 .document-sharing > section { padding:16px; }
.asfit-v2 .cv2 .cv2-document-register-split:not(:has(> aside:not([hidden]))) { grid-template-columns:1fr; }
.asfit-v2 .cv2 .cv2-inspection h3 { margin:0; font-size:16px; line-height:1.5; overflow-wrap:anywhere; }

/* True communication workspace: close to the shell edges, with independent panel scrolling. */
@media(min-width:1025px) {
 .asfit-v2 body:has(:is(.cv2-inbox,.cv2-conversation,.cv2-project-thread)) .admin-sidebar + .shell { padding:8px 12px 12px; max-width:none; }
 .asfit-v2 :is(.cv2-inbox,.cv2-conversation,.cv2-project-thread) { gap:10px; max-width:none; }
 .asfit-v2 :is(.cv2-inbox,.cv2-conversation) .page-pretitle { display:none; }
 .asfit-v2 :is(.cv2-inbox,.cv2-conversation) .page-header-row h1.page-title { font-size:22px; line-height:1.35; margin:0; }
 .asfit-v2 .cv2-inbox .page-desc { font-size:12px; margin-top:3px; }
 .asfit-v2 .cv2-inbox .cv2-inbox-split,
 .asfit-v2 body:has(.cv2-conversation) .conversation-split-workspace { height:calc(100dvh - 124px); min-height:520px; border-radius:6px; box-shadow:none; }
 .asfit-v2 .cv2-inbox .cv2-inbox-split { overflow:hidden; }
 .asfit-v2 .cv2-conversation .conversation-split-workspace { grid-template-columns:clamp(220px,19vw,300px) minmax(0,1fr) clamp(220px,18vw,280px); grid-template-areas:'queue thread context'; }
 .asfit-v2 .cv2-conversation .conversation-context-pane { display:block; grid-area:context; }
 .asfit-v2 .cv2-conversation .conversation-split-workspace.is-context-collapsed { grid-template-columns:clamp(220px,19vw,300px) minmax(0,1fr); }
 .asfit-v2 .cv2-conversation .conversation-split-workspace.is-context-collapsed .conversation-context-pane { display:none; }
 .asfit-v2 .cv2-inbox .cv2-inbox-split { grid-template-columns:clamp(280px,22vw,340px) minmax(0,1fr) 280px; }
 .asfit-v2 .cv2-inbox .conv-context-panel { display:flex; }
 .asfit-v2 .cv2-inbox .conv-queue-panel { overflow-y:auto; }
}
@media(min-width:1600px) {
 .asfit-v2 .cv2-conversation .conversation-split-workspace { grid-template-columns:320px minmax(0,1fr) 300px; }
 .asfit-v2 .cv2-conversation .conversation-split-workspace.is-context-collapsed { grid-template-columns:320px minmax(0,1fr); }
 .asfit-v2 .cv2-inbox .cv2-inbox-split { grid-template-columns:340px minmax(0,1fr) 300px; }
}
.asfit-v2 .cv2-conversation .conversation-detail-header { padding:12px 18px; gap:10px; }
.asfit-v2 .cv2-conversation .conversation-detail-identity { min-width:0; flex:1 1 220px; }
.asfit-v2 .cv2-conversation .conversation-detail-actions { width:auto; flex:0 1 auto; margin-left:auto; }
.asfit-v2 .cv2-conversation .conversation-detail-actions .button { min-height:34px; }
.asfit-v2 .cv2-conversation .conversation-active-pane > .message-list { padding:24px; gap:20px; }
.asfit-v2 .cv2-conversation .message { max-width:min(88%,760px); }
.asfit-v2 .cv2-conversation .message-body { padding:12px 16px; line-height:1.65; box-shadow:none; }
.asfit-v2 .cv2-conversation .message-meta { gap:7px; margin-bottom:7px; flex-wrap:wrap; }
.asfit-v2 .cv2-conversation .message-sender-badge { font-size:12px; color:var(--text-secondary); }
.asfit-v2 .cv2-conversation .message time { font-size:11px; font-weight:400; }
.asfit-v2 .cv2-conversation .conversation-composer { position:relative; z-index:2; box-shadow:0 -3px 12px rgba(15,23,42,.03); }
.asfit-v2 .cv2-conversation .reply-form > textarea { min-height:100px; max-height:220px; line-height:1.6; }
.asfit-v2 :is(.cv2-inbox,.cv2-conversation) .lead-inbox-controls { padding:12px; }
.asfit-v2 :is(.cv2-inbox,.cv2-conversation) .lead-inbox-quick-filters { display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; padding-bottom:5px; scrollbar-width:thin; justify-content:flex-start; }
.asfit-v2 :is(.cv2-inbox,.cv2-conversation) .lead-inbox-filter-pill { flex:0 0 auto; white-space:nowrap; }
.asfit-v2 .cv2-inbox .lead-inbox-card { grid-template-columns:20px 32px minmax(0,1fr); padding:12px; gap:8px; }
.asfit-v2 .cv2-inbox .lead-inbox-card__avatar-wrap { display:flex; grid-column:2; width:32px; }
.asfit-v2 .cv2-inbox .lead-inbox-card__content { grid-column:3; }
.asfit-v2 .cv2-inbox .lead-inbox-card--no-select { grid-template-columns:32px minmax(0,1fr); }
.asfit-v2 .cv2-inbox .lead-inbox-card--no-select .lead-inbox-card__avatar-wrap { grid-column:1; }
.asfit-v2 .cv2-inbox .lead-inbox-card--no-select .lead-inbox-card__content { grid-column:2; }
.asfit-v2 .cv2-conversation .conversation-workspace-queue .lead-inbox-card { padding:12px; min-height:100px; }
.asfit-v2 :is(.cv2-inbox,.cv2-conversation) .lead-inbox-card__contact { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.asfit-v2 .cv2-conversation .conversation-workspace-queue .lead-inbox-card__site-service,
.asfit-v2 .cv2-conversation .conversation-workspace-queue .lead-inbox-card__assignee { font-size:11px; line-height:1.4; }

/* Currency rows cannot run together, even with multiple supported currencies. */
.asfit-v2 .cv2-command .stat-kpi-value > span { display:block; font-size:22px; line-height:1.45; white-space:normal; }
.asfit-v2 .cv2-command .stat-kpi-card { display:flex; flex-direction:column; gap:8px; min-height:148px; }
.asfit-v2 .cv2-command .stat-kpi-footer { margin-top:auto; }
.asfit-v2 .cv2-command .dashboard-columns-grid { grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr); gap:16px; align-items:start; }
.asfit-v2 .cv2-command .cv2-empty { padding:8px 0; }
.asfit-v2 .cv2-command .cv2-work-list { grid-template-columns:1fr; }
.asfit-v2 .cv2-command .cv2-command-primary { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:16px; align-items:stretch; }
.asfit-v2 .cv2-command .cv2-pipeline-summary { grid-template-columns:repeat(auto-fit,minmax(100px,1fr)); }
.asfit-v2 .cv2-command-primary > :only-child { grid-column:1/-1; }
.asfit-v2 .cv2-command-primary .attention-queue-list,
.asfit-v2 .cv2-command-primary .cv2-feed { max-height:320px; overflow-y:auto; scrollbar-width:thin; }
.asfit-v2 .cv2-command .cv2-command-lower { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
.asfit-v2 .cv2-command-lower > section:last-child:nth-child(odd) { grid-column:1/-1; }
.asfit-v2 .cv2-command-lower .cv2-work-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
.asfit-v2 .cv2-command-lower .staff-status-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; }
.asfit-v2 .cv2-command-overview .asfit-btn { align-self:flex-start; margin-top:auto; }
.asfit-v2 .cv2-command-overview .asfit-card-header { flex-direction:row; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.asfit-v2 .cv2-command-overview .admin-nav-icon { color:var(--text-muted); }
.asfit-v2 .cv2-command .dashboard-panel--inbox .empty { text-align:left; padding:20px; }
.asfit-v2 .cv2-command .dashboard-panel--inbox .empty h3 { margin:0 0 6px; font-size:15px; }
.asfit-v2 .cv2-command .dashboard-panel--inbox .empty p { margin:0 0 12px; color:var(--text-muted); font-size:13px; }
.asfit-v2 .admin-sidebar .primary-nav .admin-nav-icon { width:18px; height:18px; flex:0 0 18px; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; overflow:visible; }
.asfit-v2 .admin-sidebar .primary-nav a { align-items:center; gap:10px; }
.asfit-v2 .admin-sidebar .primary-nav a > span:first-of-type { min-width:0; }
.asfit-v2 .admin-sidebar .primary-nav .nav-count-badge { flex:0 0 auto; margin-left:auto; align-self:center; }
@media(max-width:900px) {
 .asfit-v2 .cv2-command .cv2-command-primary,
 .asfit-v2 .cv2-command .cv2-command-lower { grid-template-columns:minmax(0,1fr); }
 .asfit-v2 .cv2-command .cv2-pipeline-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .asfit-v2 .cv2-command .cv2-pipeline-summary > a:last-child:nth-child(4n+3) { grid-column:span 2; }
 .asfit-v2 .cv2-command-lower .cv2-work-list,
 .asfit-v2 .cv2-command-lower .staff-status-list { grid-template-columns:1fr; }
}
@media(max-width:448px) {
 .asfit-v2 .cv2-command .cv2-pipeline-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .asfit-v2 .cv2-command .cv2-pipeline-summary > a:last-child:nth-child(3n+1) { grid-column:1/-1; }
}
.asfit-v2 .asfit-realtime-diagnostics { top:10px; bottom:auto; right:12px; z-index:46; }
.asfit-v2 body:has(.asfit-realtime-diagnostics) .admin-mobile-header { padding-right:116px; }
.asfit-v2 .asfit-realtime-diagnostics__pill-desktop { display:none; }
.asfit-v2 .asfit-realtime-diagnostics__pill-mobile { display:inline; }
.asfit-v2 .asfit-realtime-diagnostics__pill { min-height:30px; padding:4px 8px; gap:5px; font-size:10px; box-shadow:none; background:var(--bg-subtle); color:var(--text-secondary); border:1px solid var(--border-subtle); border-radius:6px; }
.asfit-v2 .asfit-realtime-diagnostics__pill:hover,
.asfit-v2 .asfit-realtime-diagnostics__pill:focus-visible { color:var(--asfit-primary); background:#fff; outline:2px solid var(--border-focus); }
.asfit-v2 .asfit-realtime-diagnostics__panel { bottom:auto; top:36px; max-height:calc(100dvh - 70px); overflow-y:auto; }

/* Wider master register, compact but useful context, and readable local table scrolling. */
@media(min-width:1025px) {
 .asfit-v2 .cv2 .cv2-contact-split { grid-template-columns:minmax(0,1fr) 300px; }
 .asfit-v2 .cv2-contact-split > .cv2-inspection { position:sticky; top:76px; }
 .asfit-v2 .cv2 .cv2-split:not(.cv2-contact-split) { grid-template-columns:minmax(0,1fr) 340px; gap:16px; }
}
.asfit-v2 .cv2 .crm-contacts-table--directory { min-width:1020px; table-layout:auto; }
.asfit-v2 .cv2 .crm-contacts-table--directory td:first-child { min-width:180px; }
.asfit-v2 .cv2 .crm-contacts-table--directory td:nth-child(2) { min-width:220px; }
.asfit-v2 .cv2 .cv2-contact-email { display:block; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.asfit-v2 .cv2 .crm-contacts-table--directory td:nth-child(2) a { display:block; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.asfit-v2 .cv2 .crm-contacts-table-wrap { overflow-x:auto; scrollbar-width:thin; }
.asfit-v2 .cv2 .crm-projects-table { table-layout:fixed; min-width:1300px; width:100%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(1) { width:18%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(2) { width:14%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(3) { width:15%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(4) { width:8%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(5) { width:9%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(6) { width:10%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(7) { width:8%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(8) { width:8%; }
.asfit-v2 .cv2 .crm-projects-table :is(th,td):nth-child(9) { width:10%; }
.asfit-v2 .cv2 .crm-projects-table td { word-break:normal; overflow-wrap:break-word; }
.asfit-v2 .cv2 .crm-projects-table .crm-contact-identity { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.asfit-v2 .cv2 .crm-followups-filters { gap:10px; }
.asfit-v2 .cv2 .sales-pipeline-column__header { gap:4px; }
.asfit-v2 .cv2 .sales-pipeline-card { padding:12px; box-shadow:none; }
.asfit-v2 .cv2 .sales-pipeline-card__meta { gap:6px; line-height:1.5; }
.asfit-v2 .cv2 .sales-pipeline-column__value { text-align:left; font-weight:600; margin-top:2px; }
.asfit-v2 .cv2 .sales-pipeline-header { align-items:center; gap:12px; flex-wrap:wrap; }
.asfit-v2 .cv2 .sales-pipeline-header__actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.asfit-v2 .cv2 .sales-pipeline-value { display:flex; align-items:baseline; gap:6px; flex-wrap:wrap; line-height:1.5; font-size:12px; }
.asfit-v2 .cv2 .sales-pipeline-value__amount { display:inline-flex; gap:4px; flex-wrap:wrap; }

/* Communication pages retain every message/action but spend more height on reading. */
.asfit-v2 .cv2-project-inbox .crm-project-message-inbox { padding:18px; }
.asfit-v2 .cv2-project-inbox .crm-project-message-inbox-list { gap:10px; }
.asfit-v2 .cv2-project-inbox .crm-project-message-inbox-item { padding:14px 16px; }
.asfit-v2 .cv2-project-inbox .crm-project-message-inbox-item__preview { margin:6px 0 0; line-height:1.6; }
.asfit-v2 .cv2-project-thread .project-banner-card { padding:16px 20px; }
.asfit-v2 .cv2-project-thread .crm-project-message-thread-header { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:16px; text-align:left; }
.asfit-v2 .cv2-project-thread .crm-project-message-thread-header > div { min-width:0; }
.asfit-v2 .cv2-project-thread .crm-project-chat-workspace { height:calc(100dvh - 236px); min-height:580px; display:flex; flex-direction:column; }
.asfit-v2 .cv2-project-thread .crm-project-message-thread { flex:1; min-height:220px; display:flex; flex-direction:column; }
.asfit-v2 .cv2-project-thread .crm-project-message-list { flex:1; min-height:160px; max-height:none; overflow-y:auto; padding:18px; gap:18px; }
.asfit-v2 .cv2-project-thread .crm-project-message article { width:fit-content; max-width:min(88%,760px); padding:12px 16px; }
.asfit-v2 .cv2-project-thread .crm-project-message--client article { background:var(--asfit-primary); border-color:var(--asfit-primary); color:#fff; }
.asfit-v2 .cv2-project-thread .crm-project-message--client article :is(strong,span,time,p) { color:#fff; }
.asfit-v2 .cv2-project-thread .crm-project-message--staff article { background:#fff; color:var(--text-body); }
.asfit-v2 .cv2-project-thread .crm-project-message--staff article p { color:var(--text-body); }
.asfit-v2 .cv2-project-thread .crm-project-message-composer { flex:0 0 auto; padding:14px 18px; }
.asfit-v2 .cv2-project-thread .crm-project-message-composer h2 { font-size:14px; margin:0 0 8px; }
.asfit-v2 .cv2-project-thread .crm-project-message-composer textarea { min-height:86px; max-height:180px; }

/* Compact, deliberate zero states and read-only grouped access. */
.asfit-v2 .cv2 .crm-followups-groups { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:12px; align-items:start; }
.asfit-v2 .cv2 .crm-followups-group:not(.crm-followups-group--empty) { grid-column:1/-1; }
.asfit-v2 .cv2 .crm-followups-group--empty { padding:16px; border:1px solid var(--border-subtle); border-radius:8px; background:#fff; min-height:115px; }
@media(min-width:1025px) {
 .asfit-v2 .cv2 .crm-followups-groups:not(:has(.crm-followups-group:not(.crm-followups-group--empty))) { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .asfit-v2 .cv2 .crm-followups-groups:not(:has(.crm-followups-group:not(.crm-followups-group--empty))) > section { grid-column:span 2; }
 .asfit-v2 .cv2 .crm-followups-groups:not(:has(.crm-followups-group:not(.crm-followups-group--empty))) > section:nth-last-child(-n+2) { grid-column:span 3; }
}
.asfit-v2 .cv2 .crm-followups-empty { margin:0; padding:8px 0 0; color:var(--text-muted); font-size:12px; }
.asfit-v2 .cv2 .cv2-zero-state { padding:36px 24px; text-align:center; border:1px dashed var(--border-subtle); border-radius:8px; background:#fff; }
.asfit-v2 .cv2 .cv2-zero-state h2 { font-size:18px; margin:0 0 10px; }
.asfit-v2 .cv2 .cv2-zero-state p { max-width:55ch; margin:0 auto 20px; line-height:1.6; color:var(--text-muted); }
.asfit-v2 .cv2-saved-replies .saved-replies-filters { margin:0; padding:14px 18px; }
.asfit-v2 .cv2-saved-replies .saved-replies-filters form { gap:12px; margin-top:12px; }
.asfit-v2 .cv2-saved-replies .saved-replies-directory { margin:0; }
.asfit-v2 .cv2 .cv2-permission-groups { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:14px; }
.asfit-v2 .cv2 .cv2-permission-group { border:1px solid var(--border-subtle); border-radius:8px; background:#fff; overflow:hidden; }
.asfit-v2 .cv2 .cv2-permission-group header { padding:14px 16px; background:var(--bg-subtle); border-bottom:1px solid var(--border-subtle); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.asfit-v2 .cv2 .cv2-permission-group h3 { font-size:14px; text-transform:capitalize; margin:0; }
.asfit-v2 .cv2 .cv2-permission-group ul { list-style:none; margin:0; padding:8px 16px; }
.asfit-v2 .cv2 .cv2-permission-group li { padding:9px 0; border-bottom:1px solid var(--border-light); font-size:12px; overflow-wrap:anywhere; }
.asfit-v2 .cv2 .cv2-permission-group li:last-child { border:0; }
.asfit-v2 .cv2 .asfit-tabs-bar { margin:0; }
.asfit-v2 .cv2 .asfit-tab-btn { padding:10px 12px; }
.asfit-v2 .cv2-account-security .security-panel { max-width:900px; padding:20px; margin:0; }
.asfit-v2 .cv2-account-security .form-stack { gap:16px; }
.asfit-v2 .cv2-account-security .panel-header { margin-bottom:18px; }
@media(max-width:1100px) {
 .asfit-v2 .cv2-inbox .cv2-inbox-split { grid-template-columns:300px minmax(0,1fr); }
 .asfit-v2 .cv2-inbox .conv-context-panel { display:none; }
 .asfit-v2 .cv2-command .dashboard-columns-grid { grid-template-columns:1fr; }
}
@media(max-width:768px) {
 .asfit-v2 .cv2-inbox .cv2-inbox-split { grid-template-columns:1fr; height:auto; }
 .asfit-v2 .cv2-conversation .conversation-active-pane > .message-list { padding:14px; gap:16px; }
 .asfit-v2 .cv2-conversation .conversation-detail-actions { width:100%; }
 .asfit-v2 .cv2-project-thread .crm-project-chat-workspace { height:auto; min-height:0; }
 .asfit-v2 .cv2-project-thread .crm-project-message-thread-header { flex-direction:column; align-items:stretch; }
 .asfit-v2 .cv2-project-thread .crm-project-message-list { max-height:60dvh; min-height:240px; }
 .asfit-v2 .asfit-realtime-diagnostics { top:14px; right:8px; }
 .asfit-v2 .asfit-realtime-diagnostics__pill { max-width:92px; }
}
