#customerDirectory { background:#fff; border-top:1px solid #dce6f0; padding:16px 0; }
#customerDirectory *, .cd-dialog *, .cd-identity-fields * { box-sizing:border-box; letter-spacing:0; }
.cd-toolbar { display:flex; align-items:end; gap:12px; padding:0 0 16px; flex-wrap:wrap; }
.cd-toolbar label { display:grid; gap:6px; font-size:13px; color:#52677e; min-width:140px; }
.cd-toolbar .cd-search { flex:1; min-width:240px; }
.cd-toolbar input, .cd-toolbar select { height:38px; padding:6px 10px; border:1px solid #d6e1ed; border-radius:4px; background:#fff; color:#233b57; width:100%; }
.cd-scroll { overflow:auto; }
.cd-profile-business[hidden] { display:none; }
.cd-profile-business { min-width:0; }
.cd-profile-business details { border-top:1px solid #e8eef5; padding:10px 0; }
.cd-profile-business summary { cursor:pointer; color:#253f5b; font-size:14px; font-weight:600; padding:4px 0; }
.cd-profile-business summary span { margin-left:12px; color:#63798f; font-size:13px; font-weight:400; }
.cd-profile-business .cd-scroll { margin-top:10px; }
.cd-profile-business .cd-table { min-width:960px; }
.cd-profile-business .cd-table th:first-child { width:22%; }
.cd-profile-business .cd-table th:last-child { width:110px; }
.cd-profile-business .cd-table th, .cd-profile-business .cd-table td { padding:10px 8px; }
.cd-table { width:100%; border-collapse:collapse; font-size:13px; table-layout:fixed; }
.cd-table th { text-align:left; color:#61768d; background:#f5f8fc; font-weight:500; padding:12px; }
.cd-table td { padding:12px; border-bottom:1px solid #e8eef5; vertical-align:top; overflow-wrap:anywhere; }
.cd-table th:first-child { width:30%; }.cd-table th:last-child { width:94px; }
.cd-table small { display:block; color:#6b8096; line-height:1.6; margin-top:4px; }
.cd-name { padding:0; border:0; background:none; text-align:left; font:inherit; font-weight:600; color:#225fa8; cursor:pointer; overflow-wrap:anywhere; }
.cd-actions, .cd-pager, .cd-pager>div { display:flex; gap:8px; align-items:center; }
.cd-pager { justify-content:space-between; padding-top:14px; color:#63798f; font-size:13px; }
.cd-status { color:#167c67; }.cd-status.is-inactive { color:#936221; }
.cd-empty { text-align:center; color:#78899d; padding:30px!important; }
.cd-dialog { width:min(1120px,calc(100vw - 64px)); max-height:90vh; padding:0; border:1px solid #d6e1ed; border-radius:6px; background:#fff; color:#253f5b; }
.cd-dialog::backdrop { background:#162a4090; }
.cd-dialog>header { display:flex; gap:20px; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid #dce6f0; }
.cd-dialog h2 { font-size:20px; line-height:1.5; margin:0; overflow-wrap:anywhere; }.cd-dialog h3 { font-size:16px; margin:16px 0 12px; }.cd-dialog h3 small { font-size:13px; font-weight:400; color:#64748b; }
#cdDetailBody { max-height:calc(90vh - 150px); overflow:auto; padding:0 20px 20px; }
.cd-facts { display:grid; grid-template-columns:2fr 1fr 100px; gap:20px; border-bottom:1px solid #dce6f0; padding-bottom:16px; }
.cd-facts dt { font-size:12px; color:#6b8096; }.cd-facts dd { margin:6px 0 0; overflow-wrap:anywhere; }
.cd-dialog footer { padding:12px 20px; border-top:1px solid #dce6f0; display:flex; gap:8px; justify-content:flex-end; }
.cd-dialog .cd-table { min-width:850px; }.cd-dialog .cd-table th:first-child { width:22%; }.cd-dialog .cd-table th:last-child { width:60px; }.cd-table .cd-number { text-align:right; font-variant-numeric:tabular-nums; }
.cd-dialog button svg, .cm-create svg { width:16px; height:16px; flex-shrink:0; }
.cd-dialog button, .cm-create { display:inline-flex; align-items:center; gap:6px; }
.cd-duplicates { border-left:3px solid #ca963f; background:#fffaf0; padding:10px 12px; color:#805719; font-size:13px; grid-column:1/-1; }
.cd-duplicates small { color:#677b8d; }.cd-duplicates[hidden] { display:none; }
.cd-identity-fields { margin-top:16px; }.cd-identity-fields small { font-size:12px; color:#6b8096; line-height:1.6; }
.cm-create { justify-self:start; font-size:13px; border-radius:4px; }
.cd-toolbar :focus-visible, .cd-name:focus-visible, .cd-dialog :focus-visible { outline:2px solid #267dcc; outline-offset:2px; }

/* Directory controls and compact rows stay scoped away from financial dialogs. */
#customerDirectory { padding:12px 0 0; }
#customerDirectory .cd-quick { display:flex; gap:4px; flex-wrap:wrap; border-bottom:1px solid #dce6f0; padding-bottom:10px; margin-bottom:12px; }
.cd-quick button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:36px; padding:6px 12px; border:1px solid transparent; border-radius:4px; background:transparent; color:#52677e; font:inherit; font-size:13px; cursor:pointer; }
.cd-quick button span { font-size:12px; font-variant-numeric:tabular-nums; }
.cd-quick button[aria-pressed=true] { background:#eaf3ff; border-color:#bbd6f5; color:#175d9f; font-weight:600; }
.cd-quick button:hover { background:#f0f5fa; }
#customerDirectory .cd-toolbar { display:grid; grid-template-columns:minmax(240px,2.2fr) repeat(4,minmax(115px,1fr)) 36px; gap:10px; padding-bottom:10px; }
#customerDirectory .cd-toolbar label, #customerDirectory .cd-toolbar .cd-search { min-width:0; }
#customerDirectory .icon-button { display:inline-flex; width:32px; height:32px; min-width:32px; padding:6px; align-items:center; justify-content:center; border:1px solid #d6e1ed; border-radius:4px; background:#fff; color:#2763a4; flex-shrink:0; }
#customerDirectory .icon-button:hover { background:#eaf3ff; border-color:#91b4da; }
#customerDirectory .icon-button:disabled { opacity:.4; cursor:default; }
#customerDirectory .icon-button svg { width:16px; height:16px; }
#customerDirectory .cd-results { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:0 0 10px; color:#63798f; font-size:13px; }
#customerDirectory .cd-results label, #customerDirectory .cd-pager label { display:flex; align-items:center; gap:8px; white-space:nowrap; }
#customerDirectory .cd-sort-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
#customerDirectory .cd-sort-controls label { flex:0 0 auto; }
#customerDirectory #cdSort { width:136px; flex:0 0 136px; }
#customerDirectory #cdSortDirection { width:166px; flex:0 0 166px; }
#customerDirectory .cd-results select, #customerDirectory .cd-pager select { color:#344e68; background:#fff; border:1px solid #d6e1ed; border-radius:4px; min-height:32px; padding:4px 8px; font:inherit; }
#customerDirectory .cd-list-scroll { max-height:calc(100vh - 400px); min-height:160px; border-top:1px solid #e3eaf2; border-bottom:1px solid #e3eaf2; scrollbar-gutter:stable; }
#customerDirectory .cd-list-table { min-width:960px; }
.cd-col-index { width:56px; }.cd-col-name { width:26%; }.cd-col-owner { width:15%; }.cd-col-region { width:8%; }.cd-col-follow { width:23%; }.cd-col-business { width:14%; }.cd-col-actions { width:9%; }
#customerDirectory .cd-list-table th { position:sticky; top:0; z-index:1; padding:10px 12px; height:40px; color:#4f6680; font-weight:600; }
#customerDirectory .cd-list-table th:first-child, #customerDirectory .cd-list-table th:last-child { width:auto; }
#customerDirectory .cd-list-table td { height:60px; padding:8px 12px; vertical-align:middle; line-height:1.5; color:#344e68; }
#customerDirectory .cd-list-table .cd-index { text-align:center; color:#63798f; font-variant-numeric:tabular-nums; white-space:nowrap; }
#customerDirectory .cd-list-table tbody tr:hover { background:#f5f9fd; }
#customerDirectory .cd-list-table small { margin-top:2px; }
#customerDirectory .cd-name { color:#214c78; font-size:13px; line-height:1.5; }
#customerDirectory .cd-name:hover { color:#1768af; text-decoration:underline; }
#customerDirectory .cd-truncate { display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#customerDirectory .cd-follow-summary { border:0; padding:0; background:transparent; color:#60738a; font:inherit; font-size:12px; text-align:left; cursor:pointer; margin-top:2px; line-height:1.6; }
#customerDirectory .cd-follow-summary:hover { color:#1768af; text-decoration:underline; }
#customerDirectory time { font-size:12px; font-variant-numeric:tabular-nums; }
#customerDirectory .cd-muted { color:#748399; font-size:12px; }
#customerDirectory .cd-warning { color:#9a650f; }
#customerDirectory .cd-inactive { display:inline-block; color:#825d28; background:#fff3df; font-size:11px; padding:0 4px; margin-left:6px; border-radius:3px; }
#customerDirectory .cd-business { display:grid; gap:2px; }
#customerDirectory .cd-business-link { display:inline-flex; align-items:center; gap:4px; width:fit-content; border:0; background:transparent; padding:0; color:#246399; font:inherit; font-size:12px; line-height:1.6; cursor:pointer; }
#customerDirectory .cd-business-link:hover { text-decoration:underline; }
#customerDirectory .cd-business-link svg { width:12px; height:12px; }
#customerDirectory .cd-empty .cd-business-link { display:flex; margin:10px auto 0; }
#customerDirectory .cd-actions { gap:6px; }
#customerDirectory .cd-pager { flex-wrap:wrap; padding:10px 0; gap:10px; }
#customerDirectory #cdPager { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#customerDirectory :focus-visible { outline:2px solid #267dcc; outline-offset:2px; }
#cdFilterToggle { display:none; }
@media (max-width:1200px) {
  #customerDirectory .cd-toolbar { grid-template-columns:minmax(180px,2fr) repeat(2,minmax(130px,1fr)); }
  #customerDirectory .cd-list-scroll { max-height:calc(100vh - 450px); }
}
@media (max-width:600px) {
  #customerDirectory .cd-quick { display:grid; grid-template-columns:1fr 1fr; }
  #customerDirectory .cd-toolbar { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  #customerDirectory .cd-search { grid-column:1/-1; }
  #customerDirectory:not(.cd-show-filters) .cd-extra-filter { display:none; }
  #customerDirectory #cdFilterToggle { display:inline-flex; align-items:center; gap:6px; justify-self:start; min-height:32px; padding:4px 8px; background:#fff; border:1px solid #d6e1ed; border-radius:4px; color:#2763a4; font:inherit; font-size:13px; }
  #cdFilterToggle svg { width:16px; height:16px; }
  #customerDirectory #cdReset { justify-self:end; }
  #customerDirectory .cd-results { flex-wrap:wrap; }
  #customerDirectory .cd-list-scroll { max-height:55vh; }
  #customerDirectory .cd-pager { align-items:flex-start; }
  #customerDirectory #cdPager { gap:6px; }
  .cd-dialog { width:calc(100vw - 24px); }
  .cd-dialog>header { padding:12px; gap:12px; }
  .cd-dialog h2 { font-size:17px; }
  .cd-facts { grid-template-columns:1fr; gap:10px; }
  #cdDetailBody { padding:0 12px 12px; }
}
