/* ---------- Teams ------------------------------------------------------------- */
/* Teams and their people, invitations, avatars, and the marks that shared
   work carries elsewhere (shared notes, assignees, read-only cards). */

.person-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--secondary-wash);
  color: var(--secondary-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.teams-list,
.team-page,
.teams-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teams-page .page-header,
.team-page .page-header {
  margin-bottom: 8px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.team-row:hover {
  border-color: var(--line-hover);
}

.team-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.team-row-name {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.team-row-meta,
.team-member-email {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.team-row-people {
  display: flex;
  flex: none;
}

.team-row-people .person-avatar {
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--surface);
}

.team-invite-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-color: var(--primary);
  background: var(--primary-wash);
}

.team-invite-card p {
  margin: 0;
  color: var(--ink-soft);
}

.teams-explainer h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.team-roles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}

.team-roles div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.team-roles dt {
  color: var(--ink-soft);
  font-weight: 600;
}

.team-roles dd {
  margin: 0;
  color: var(--body);
  font-size: 0.9rem;
}

.team-members,
.team-clients {
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-member,
.team-client {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.team-member:first-child,
.team-client:first-child {
  border-top: none;
}

.team-member .person-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.team-member.is-pending .person-avatar {
  background: var(--surface-sunken);
  color: var(--muted);
}

.team-member {
  flex-wrap: nowrap;
}

.team-member-main {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
}

.team-member-name {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.team-you {
  color: var(--muted);
  font-weight: 400;
}

.team-role {
  color: var(--body);
  font-size: 0.88rem;
}

.team-role-form select {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
}

.team-subheading {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-invite-form {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.team-invite-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.team-invite-fields input:not([type="submit"]) {
  flex: 1 1 220px;
}

.team-invite-fields select {
  flex: 0 0 auto;
  width: auto;
}

.team-client-link {
  color: var(--ink);
  text-decoration: none;
}

.team-client-link:hover {
  color: var(--primary-ink);
}

.team-danger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.team-settings {
  width: 100%;
}

.team-settings summary {
  color: var(--body);
  font-weight: 600;
  cursor: pointer;
}

.team-settings[open] summary {
  margin-bottom: 12px;
}

.team-settings form + form,
.team-settings form + .button_to {
  margin-top: 12px;
}

.invitation-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.invitation-card h1 {
  font-size: 1.6rem;
}

.invitation-card p {
  margin: 0;
  color: var(--body);
}

.invitation-icon {
  display: inline-flex;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--secondary-wash);
  color: var(--secondary-ink);
}

/* Shared work elsewhere in the app. */

.shared-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--secondary-wash);
  color: var(--secondary-ink);
  font-size: 0.88rem;
}

.shared-note-icon,
.client-shared {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shared-note-icon .tab-icon,
.client-shared .tab-icon {
  width: 16px;
  height: 16px;
}

.board-card-assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--body);
  font-size: 0.8rem;
}

.board-card-assignee .person-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
}

/* Work someone's role can't change: the controls inside are disabled. */
.read-only-fields {
  display: contents;
}

.is-read-only .board-card-footer,
.is-read-only .board-card-blocker-edit,
.is-read-only .task-actions,
.is-read-only .task-more,
.is-read-only .task-drag-handle,
.is-read-only .task-inline-action {
  display: none;
}

.board-card.is-read-only {
  cursor: default;
}

.clients-shared {
  margin-top: 28px;
}

.clients-shared h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.hours-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 8px;
  color: var(--body);
  font-size: 0.85rem;
}

.hours-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hours-person .person-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
}

.task-time-entry-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--body);
  font-size: 0.82rem;
}

.task-time-entry-person .person-avatar {
  width: 20px;
  height: 20px;
  font-size: 0.6rem;
}

.profile-name-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.profile-name-form .form-input {
  width: 100%;
}

.profile-hint {
  margin-top: 8px;
  font-size: 0.88rem;
}

/* Comments on a shared task, and the team's activity feed. */

.task-comments {
  margin-top: 20px;
}

.task-comments h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.task-comment-list,
.team-activity {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.task-comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.task-comment:first-child {
  border-top: none;
}

.task-comment-main {
  flex: 1;
  min-width: 0;
}

.task-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.task-comment-header time {
  flex: 1;
  color: var(--muted);
  font-size: 0.8rem;
}

.task-comment-body {
  margin-top: 2px;
  color: var(--body);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.task-comment-body p + p {
  margin-top: 6px;
}

.board-card-comments {
  width: fit-content;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.board-card-comments:hover {
  color: var(--primary-ink);
}

.team-activity-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
}

.team-activity-item:first-child {
  border-top: none;
}

.team-activity-item .person-avatar {
  align-self: center;
}

.team-activity-text {
  flex: 1;
  min-width: 0;
  color: var(--body);
  overflow-wrap: anywhere;
}

.team-activity-text a {
  color: var(--ink);
  font-weight: 500;
}

.team-activity-item time {
  flex: none;
  color: var(--faint);
  font-size: 0.8rem;
}

.team-role-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.team-rate-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.team-rate-field input {
  width: 96px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
}

.team-rate-unit {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Notifications page. */

.notification-list {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.notification + .notification {
  border-top: 1px solid var(--line-soft);
}

.notification-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.notification-link:hover {
  background: var(--tint);
}

.notification.is-unread .notification-link {
  background: var(--primary-wash);
}

.notification-link .person-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.notification-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notification-text {
  color: var(--ink-soft);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.notification.is-unread .notification-text {
  color: var(--ink);
  font-weight: 600;
}

.notification-excerpt {
  color: var(--body);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.notification-main time {
  color: var(--muted);
  font-size: 0.8rem;
}

.notification-dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}
