/* clients module — Clients list, client detail, Contacts.
   Every class is prefixed cl- because all module stylesheets load globally.
   Tokens from app.css only (no raw colours). */

/* ───────── clients list ───────── */
.cl-client-cell { min-width: 180px; max-width: 320px; }
.cl-client-cell .cell-title { display: inline-block; text-decoration: none; }
.cl-client-cell .cell-title:hover,
.cl-client-cell .cell-title:focus-visible { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.cl-client-cell .cell-sub { margin-top: 4px; }
.cl-contact-name { max-width: 160px; }
.cl-reach { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.cl-count { padding: 0 16px 8px; }

.cl-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cl-seg::-webkit-scrollbar { display: none; }
.cl-filter { flex: 0 1 190px; min-width: 150px; display: block; }
label.cl-filter .input { width: 100%; }

/* clickable stat tiles that double as filters */
.cl-stat { display: flex; min-width: 0; }
.cl-stat > .stat { flex: 1 1 auto; }
.cl-stat.is-on > .stat { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: var(--surface-2); }

/* ───────── client detail ───────── */
.cl-usage-alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.cl-usage-alert .icon { margin-top: 2px; }
.cl-usage-alert .small { color: var(--text-2); margin-top: 2px; }
.cl-usage-alert.is-red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.cl-usage-alert.is-red .icon,
.cl-usage-alert.is-red strong { color: var(--red-ink); }
.cl-usage-alert.is-amber { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.cl-usage-alert.is-amber .icon,
.cl-usage-alert.is-amber strong { color: var(--amber-ink); }

.cl-rel.is-cold { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.cl-rel-headline { font-weight: 600; font-size: 14px; line-height: 1.4; }
.cl-rel-actions { margin-top: 6px; }
.cl-bday {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--text); font-size: 13px;
}
.cl-bday .icon { color: var(--amber-ink); }

.cl-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-strong); display: inline-block; flex: none; }
.cl-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; white-space: nowrap; }

/* ───────── small screens ───────── */
@media (max-width: 640px) {
  .cl-seg { flex: 1 1 100%; }
  .cl-filter { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .cl-client-cell { min-width: 150px; }
  .cl-contact-name { max-width: 110px; }
  .cl-usage-alert { padding: 10px 12px; }
}
