/* ATLAS V6 — Client CRM / Relationship Health */

/* Page layout — real view id is #view-clientcare (data-view="clientcare");
   aliases kept for the spec's data-view="clients" naming. */
#view-clientcare, [data-view="clientcare"],
#view-clients, [data-view="clients"] {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Health score strip */
.v6-crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.v6-crm-tile {
  background: rgba(255,253,248,.94);
  border: 1px solid #d7d0c3;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(29,24,14,.07);
}

.v6-crm-tile-val {
  font: 850 26px/1.1 "Aptos Display", Inter, "Segoe UI", system-ui;
  color: #c18a25;
  margin-bottom: 3px;
}

.v6-crm-tile-label { font-size: 13px; color: #647184; }

/* Toolbar */
.v6-crm-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.v6-crm-search {
  flex: 1;
  height: 38px;
  border: 1px solid #d7d0c3;
  background: #f0eee8;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: 0;
  color: #101722;
}

.v6-crm-search:focus { border-color: #c18a25; background: #fffdf8; }

.v6-owner-chips { display: flex; gap: 6px; }

.v6-owner-chip {
  height: 34px; padding: 0 12px; border-radius: 999px;
  font: 750 13px Inter; color: #647184;
  border: 1px solid #d7d0c3; background: #fffdf8;
  cursor: pointer; white-space: nowrap;
}

.v6-owner-chip.active {
  background: #fbecd0; color: #7a4a0a; border-color: #e8c87a;
}

/* Relationship health table */
.v6-crm-table-wrap {
  flex: 1;
  overflow-y: auto;
  background: rgba(255,253,248,.94);
  border: 1px solid #d7d0c3;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(29,24,14,.07);
}

.v6-crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.v6-crm-table th {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #647184;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid #d7d0c3;
  background: #f6f3ec;
  position: sticky;
  top: 0;
  z-index: 1;
}

.v6-crm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ebe7de;
  vertical-align: middle;
}

.v6-crm-table tr:last-child td { border-bottom: 0; }

.v6-crm-table tr:hover td {
  background: rgba(193,138,37,.03);
}

/* Client name cell */
.v6-client-name { font-weight: 750; color: #101722; }
.v6-client-type { font-size: 12px; color: #8a95a3; margin-top: 2px; }

/* Health score pill */
.v6-health-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font: 800 12px "JetBrains Mono", monospace;
}

.v6-health-score.hot   { background: #dff2e7; color: #17623a; }
.v6-health-score.warm  { background: #fbecd0; color: #7a4a0a; }
.v6-health-score.cold  { background: #fde1ea; color: #9c1844; }
.v6-health-score.new   { background: #e0e9fb; color: #17468e; }

/* Stage badge */
.v6-stage-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 750;
  background: #ebe7de;
  color: #647184;
}

/* Row actions (show on hover) */
.v6-row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}

.v6-crm-table tr:hover .v6-row-actions { opacity: 1; }

.v6-row-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font: 750 12px Inter;
  border: 1px solid #d7d0c3;
  background: #fffdf8;
  cursor: pointer;
  white-space: nowrap;
}

.v6-row-btn.primary { background: #fbecd0; color: #7a4a0a; border-color: #e8c87a; }

/* Owner avatar */
.v6-owner-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #0f857c, #c18a25);
  color: white; font: 700 10px Inter;
  display: inline-grid; place-items: center;
}

/* Dark theme */
[data-theme="dark"] .v6-crm-tile,
[data-theme="dark"] .v6-crm-table-wrap { background: rgba(22,30,40,.95); border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .v6-crm-table th { background: rgba(15,21,27,.8); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .v6-crm-table td { border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .v6-crm-tile-val { color: var(--gold); }
[data-theme="dark"] .v6-client-name { color: #edf4fb; }
[data-theme="dark"] .v6-owner-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #9fb0bf; }
[data-theme="dark"] .v6-crm-search { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.15); color: #edf4fb; }
[data-theme="dark"] .v6-row-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #edf4fb; }
