/* Relationships & care team (Client/Components/PatientContactsBoard.razor, with PatientRelationships and
   PatientCareTeams as its two sections, and PatientHousehold's compact status row). Personal contacts and care team
   sit side by side on desktop and stack before names or phone numbers would be clipped. */
.ct {
    --ct-accent: var(--rz-primary, #1d4ed8);
    --ct-text: var(--rz-text-color, #1e293b);
    --ct-muted: var(--rz-text-secondary-color, #64748b);
    --ct-border: var(--rz-base-300, #e2e8f0);
    --ct-surface: var(--rz-base-background-color, #fff);
    --ct-raised: var(--rz-base-50, #f8fafc);
    --ct-bad: var(--rz-danger, #dc2626);
    color: var(--ct-text);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ct-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.ct-switch { display: inline-flex; border: 1px solid var(--ct-border); border-radius: 8px; overflow: hidden; }
.ct-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--ct-surface); color: var(--ct-text);
    padding: 6px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ct-switch button + button { border-left: 1px solid var(--ct-border); }
.ct-switch button.on { background: var(--ct-accent); color: #fff; }

/* Shared phone, when there is nothing to act on */
.ct-status { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid var(--ct-border, #e2e8f0);
    border-radius: 10px; background: var(--ct-raised, #f8fafc); font-size: 14px; }
.ct-status-sep { width: 1px; align-self: stretch; background: var(--ct-border, #e2e8f0); }

/* The two sections */
.ct-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ct-section { border: 1px solid var(--ct-border); border-radius: 12px; background: var(--ct-surface); padding: 14px 16px; min-width: 0; }
.ct-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ct-section-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.ct-empty { margin: 4px 0; color: var(--ct-muted); }
.ct-muted { color: var(--ct-muted); }

/* Cards: name, role, then the number to call */
.ct-cards { display: flex; flex-direction: column; gap: 10px; }
.ct-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start;
    border: 1px solid var(--ct-border); border-radius: 10px; padding: 12px 14px; background: var(--ct-surface); }
.ct-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px;
    background: color-mix(in srgb, var(--ct-accent) 14%, transparent); color: var(--ct-accent); }
.ct-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.ct-role { color: var(--ct-muted); font-size: 13.5px; }
.ct-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 14px; }
.ct-facts b { font-weight: 600; margin-right: 4px; }
.ct-facts a, .ct-table a { color: inherit; text-decoration: none; white-space: nowrap; }
.ct-facts a:hover, .ct-table a:hover { color: var(--ct-accent); text-decoration: underline; }
.ct-email a { white-space: normal; overflow-wrap: anywhere; }
.ct-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
    color: var(--ct-bad); background: color-mix(in srgb, var(--ct-bad) 12%, transparent); }
.ct-actions, .ct-td-actions { display: flex; align-items: center; gap: 6px; }

/* List */
.ct-table-wrap { overflow-x: auto; border: 1px solid var(--ct-border); border-radius: 8px; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ct-table th { text-align: left; font-weight: 600; padding: 9px 12px; background: var(--ct-raised); border-bottom: 1px solid var(--ct-border); white-space: nowrap; }
.ct-table td { padding: 8px 12px; border-bottom: 1px solid var(--ct-border); vertical-align: middle; }
.ct-table tr:last-child td { border-bottom: 0; }
.ct-table .ct-name { font-size: 14px; margin-right: 6px; }
.ct-nowrap { white-space: nowrap; }
.ct-th-actions { width: 1%; }

/* Stack the sections before names or numbers get clipped. */
@media (max-width: 1280px) {
    .ct-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .ct-card { grid-template-columns: auto minmax(0, 1fr); }
    .ct-actions { grid-column: 1 / -1; }
}
