/* Clients & Contacts + client profile (page layer on DS v4 + app.css) */
.page-content > * + * { margin-block-start: var(--space-5); }
.page-content > .page-head + .stats-grid { margin-block-start: var(--space-5); }
.cl-tabs { margin-block-end: calc(-1 * var(--space-2)); }
.cl-name { text-decoration: none; color: inherit; }
.cl-name:hover .td-primary { color: var(--accent-text); }
.cl-name .u-meta { display: flex; flex-direction: column; min-width: 0; }
.cl-logo { font-size: 11px; font-weight: var(--weight-extrabold); color: var(--text-secondary); background: var(--bg-card-hover); letter-spacing: .02em; }
.cl-last { display: inline-flex; align-items: center; gap: 5px; }
.cl-last svg { width: 13px; height: 13px; }
.cl-last.is-dormant { color: var(--warning-text); font-weight: var(--weight-semibold); }
.table td .td-sub { display: block; }
.stat-card a.stat-chg { text-decoration: none; }
.form-grid > .alert.full { grid-column: 1 / -1; }

/* client profile */
.cp-logo { font-size: 26px; font-weight: var(--weight-extrabold); letter-spacing: .02em; color: var(--text-primary); }
.prof-hero-meta a { color: var(--accent-text); text-decoration: none; }
.cp-section { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-5); }
.cp-section + .cp-section { margin-block-start: var(--space-4); }
.cp-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-block-end: var(--space-4); }
.cp-section-head h2 { margin: 0; font-size: var(--text-md); font-weight: var(--weight-bold); display: flex; align-items: center; gap: 8px; }
.cp-section-head h2 svg { width: 17px; height: 17px; color: var(--text-muted); }
.cp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: 10px 8px; border-radius: var(--radius-md); text-decoration: none; color: inherit; }
.cp-row + .cp-row { border-block-start: 1px solid var(--border-subtle); }
a.cp-row:hover { background: var(--bg-card-hover); }
.cp-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cp-row-main b { font-weight: var(--weight-semibold); font-size: var(--text-base-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row-main small { color: var(--text-muted); font-size: var(--text-sm); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cp-row-main small svg { width: 13px; height: 13px; }
.cp-row .cp-val { font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; font-size: var(--text-base-sm); }
.cp-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.cp-contact { border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: 10px; }
.cp-contact .u-name { font-weight: var(--weight-semibold); }
.cp-contact-links { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); }
.cp-contact-links a, .cp-contact-links span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-contact-links svg { width: 13px; height: 13px; flex-shrink: 0; }
.cp-contact-links a:hover { color: var(--accent-text); }
.cp-health .dl { font-size: var(--text-base-sm); }
.cp-overdue { color: var(--danger-text); font-weight: var(--weight-semibold); }
.cp-today { color: var(--warning-text); font-weight: var(--weight-semibold); }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-merge { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.cp-merge .choice-card { text-align: start; }
@container page (max-width: 600px) {
  .cp-merge { grid-template-columns: 1fr; }
  .cp-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cp-row .cp-val { grid-column: 2; grid-row: 1; }
}
.table .tag-chip, .table .lbl { white-space: nowrap; }
.cl-name .td-primary { white-space: nowrap; }
.cl-name .td-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.cl-table td { white-space: nowrap; }
.prof-hero-stats { --cols: 4; }
@container page (max-width: 900px) { .prof-hero-stats { --cols: 2; } }
@container page (max-width: 560px) { .prof-hero-stats { --cols: 1; } }
.cp-row-main small .cp-today { display: inline-flex; align-items: center; gap: 4px; }
.cp-merge { grid-template-columns: 1fr; }
.cp-row > .lbl { justify-self: start; }
