/* =====================================================================
   HOMECARE — Profile and active-unit context (M01 PART 04)
   ===================================================================== */

.hc-profile-page {
  gap: var(--hc-space-5);
}

.hc-profile-page [hidden] {
  display: none !important;
}

.hc-profile-heading p,
.hc-profile-section-note {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-profile-alert {
  padding: var(--hc-space-3);
  color: var(--hc-danger-600);
  background: var(--hc-danger-50);
  border: 1px solid var(--hc-danger-500);
  border-radius: var(--hc-radius-md);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-medium);
}

.hc-profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--hc-space-3);
  align-items: start;
}

.hc-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: var(--hc-text-inverse);
  background: var(--hc-color-primary);
  border-radius: var(--hc-radius-pill);
  font-size: var(--hc-font-size-md);
  font-weight: var(--hc-font-weight-bold);
}

.hc-profile-identity__main {
  min-width: 0;
}

.hc-profile-identity__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hc-space-2);
}

.hc-profile-identity__title h3 {
  min-width: 0;
}

.hc-profile-contact {
  display: grid;
  gap: var(--hc-space-2);
  margin-top: var(--hc-space-3);
}

.hc-profile-contact > div {
  min-width: 0;
}

.hc-profile-contact dt,
.hc-profile-details dt {
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
}

.hc-profile-contact dd,
.hc-profile-details dd {
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-medium);
  overflow-wrap: anywhere;
}

.hc-profile-current-unit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-4);
  padding: var(--hc-space-5);
  background: var(--hc-color-accent-weak);
  border: 1px solid var(--hc-blue-400);
  border-radius: var(--hc-radius-lg);
  box-shadow: var(--hc-shadow-sm);
}

.hc-profile-current-unit__badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--hc-space-2);
}

.hc-profile-current-unit__eyebrow {
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  font-weight: var(--hc-font-weight-medium);
}

.hc-profile-current-unit__code {
  margin-top: var(--hc-space-1);
  color: var(--hc-color-primary-strong);
  font-size: var(--hc-font-size-xl);
  font-weight: var(--hc-font-weight-bold);
  line-height: var(--hc-leading-tight);
}

.hc-profile-current-unit__location {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-profile-details {
  padding: 0;
  overflow: hidden;
}

.hc-profile-details > div {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.7fr);
  gap: var(--hc-space-3);
  padding: var(--hc-space-3) var(--hc-space-4);
  border-bottom: 1px solid var(--hc-border);
}

.hc-profile-details > div:last-child {
  border-bottom: 0;
}

.hc-profile-household {
  padding: 0;
  overflow: hidden;
}

.hc-profile-household__member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hc-space-3);
  min-height: 52px;
  padding: var(--hc-space-3) var(--hc-space-4);
  border-bottom: 1px solid var(--hc-border);
}

.hc-profile-household__member:last-child {
  border-bottom: 0;
}

.hc-profile-household__name {
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-sm);
  font-weight: var(--hc-font-weight-semibold);
}

.hc-profile-household__relationship {
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  text-align: right;
}

.hc-profile-household__empty {
  padding: var(--hc-space-4);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

.hc-profile-unit-options {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
}

.hc-profile-unit-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--hc-space-3);
  align-items: center;
}

.hc-profile-unit-option--active {
  background: var(--hc-color-accent-weak);
  border-color: var(--hc-blue-400);
}

.hc-profile-unit-option__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: var(--hc-space-1);
}

.hc-profile-unit-option__unit {
  color: var(--hc-text-strong);
  font-size: var(--hc-font-size-md);
  font-weight: var(--hc-font-weight-bold);
}

.hc-profile-unit-option__location {
  max-width: 100%;
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hc-profile-unit-option__action {
  display: flex;
  justify-content: flex-end;
}

.hc-profile-account {
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-4);
}

.hc-profile-account h3 {
  font-size: var(--hc-font-size-md);
}

.hc-profile-account p {
  margin-top: var(--hc-space-1);
  color: var(--hc-text-muted);
  font-size: var(--hc-font-size-sm);
}

@media (max-width: 359px) {
  .hc-profile-current-unit {
    align-items: flex-start;
    flex-direction: column;
  }

  .hc-profile-details > div {
    grid-template-columns: 1fr;
    gap: var(--hc-space-1);
  }

  .hc-profile-unit-option {
    grid-template-columns: 1fr;
  }

  .hc-profile-unit-option__action,
  .hc-profile-unit-option__action .hc-btn {
    width: 100%;
  }
}
