

.team-member-form {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  width: 100%;
  max-width: none;
}

.team-member-form label {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.team-member-form input {
  width: 100%;
  min-width: 0;
  margin: 0;
  margin-bottom: 0;
  padding: 11px 12px;
  border-radius: 12px;
  box-sizing: border-box;
  font-weight: 500;
  background: var(--mist);
}

.team-member-editor .team-counter-branches-panel {
  margin-top: 0.85rem;
}

.team-member-editor .team-permissions-groups {
  margin-bottom: 0;
}

#team-member-list.team-member-list,
#team-member-list.team-member-list.org-access-member-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.team-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 108px);
  gap: 12px;
  align-items: start;
  justify-content: start;
  min-width: 0;
}

.team-member-chip {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 0.4rem;
  width: 108px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-brand);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: transform 140ms ease;
}

.team-member-chip:hover {
  transform: translateY(-2px);
}

.team-member-chip-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: var(--mist, #f5f4f2);
  box-shadow: 0 8px 22px rgba(18, 18, 18, 0.08);
  border: 2px solid transparent;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.team-member-chip.is-active .team-member-chip-media {
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgba(18, 18, 18, 0.12);
}

.team-member-chip.is-hidden-member:not(.is-active) .team-member-chip-media {
  opacity: 0.72;
  filter: grayscale(0.25);
}

.team-member-chip-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #6b3a2a;
  background: linear-gradient(145deg, #f4d6c8, #e8b8a4);
}

.team-member-chip[data-tone="1"] .team-member-chip-initial {
  color: #7a2e4a;
  background: linear-gradient(145deg, #f8d5e0, #eeb8c8);
}

.team-member-chip[data-tone="2"] .team-member-chip-initial {
  color: #1f4d41;
  background: linear-gradient(145deg, #d5ebe4, #b8d9ce);
}

.team-member-chip[data-tone="3"] .team-member-chip-initial {
  color: #2a3b5e;
  background: linear-gradient(145deg, #d9e2f0, #bccce3);
}

.team-member-chip[data-tone="4"] .team-member-chip-initial {
  color: #6a4a12;
  background: linear-gradient(145deg, #f3e4c8, #e6cf9a);
}

.team-member-chip[data-tone="5"] .team-member-chip-initial {
  color: #3d5a38;
  background: linear-gradient(145deg, #dce9d8, #c2d6bc);
}

.team-member-chip[data-tone="6"] .team-member-chip-initial {
  color: #6b3f32;
  background: linear-gradient(145deg, #f0ddd4, #e0c4b6);
}

.team-member-chip[data-tone="7"] .team-member-chip-initial {
  color: #1f4d5a;
  background: linear-gradient(145deg, #d4eaf0, #b5d6e0);
}

.team-member-chip[data-tone="8"] .team-member-chip-initial {
  color: #4a3a5c;
  background: linear-gradient(145deg, #e6dced, #d0c2dc);
}

.team-member-chip-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 2);
  padding: 0 2px;
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}

.team-member-chip.is-active .team-member-chip-name {
  color: var(--ink);
}

.team-member-chip-status {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(18, 18, 18, 0.12);
}

.team-member-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.team-member-chip-status.is-pending .team-member-chip-dot {
  background: #d97706;
}

.team-member-chip-status.is-disabled .team-member-chip-dot {
  background: #a8a29e;
}

.team-member-detail {
  width: 100%;
}

.team-member-list > .muted-text {
  margin: 0;
  padding: 1rem;
}

.team-member-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border);
}

.team-member-row:first-child {
  border-top: 0;
}

.team-member-row strong,
.team-member-row small {
  display: block;
}

.team-member-row strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.team-member-row small {
  margin-top: 0.1rem;
  font-size: 0.74rem;
  line-height: 1.3;
  opacity: 0.72;
}

.team-member-meta {
  min-width: 0;
}

.team-member-perms {
  font-weight: 500 !important;
  opacity: 0.85 !important;
}

.team-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.team-member-actions .secondary-btn,
.team-member-actions .primary-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  min-height: 0;
  width: auto;
  max-width: none;
}

.team-member-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: var(--mist);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .team-name-row {
    grid-template-columns: 1fr;
  }

  .team-member-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .team-member-actions {
    justify-content: flex-start;
  }

  .team-permissions-grid {
    grid-template-columns: 1fr;
  }
}

.catalogue-collections-list,
.bookings-board-list,
#api-keys-list,
.portal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: stretch;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: none;
  padding: 0;
  margin: 0;
  list-style: none;
}

.team-member-list > .muted-text,
.team-member-list > .settings-intro,
.catalogue-collections-list > .shop-empty-state,
.catalogue-collections-list > .muted-line,
.bookings-board-list > .muted-text,
#api-keys-list > .muted-text,
.portal-list > .muted-text {
  margin: 0;
  padding: 0.9rem 0.95rem;
  border: 0;
  background: transparent;
}

.org-access-member-card.team-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 0.9rem 0.95rem;
}

.team-member-row,
.catalogue-collection-card,
.booking-board-card,
.api-key-row,
.portal-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  transition: background 140ms ease;
}

.team-member-row:last-child,
.catalogue-collection-card:last-child,
.booking-board-card:last-child,
.api-key-row:last-child,
.portal-list-row:last-child {
  border-bottom: 0;
}

.team-member-row:hover,
.catalogue-collection-card:hover,
.booking-board-card:hover,
.api-key-row:hover,
.portal-list-row:hover {
  background: rgba(42, 41, 39, 0.035);
}

.team-member-row > .app-tile-body,
.catalogue-collection-card > .app-tile-body,
.booking-board-card > .app-tile-body,
.api-key-row > .app-tile-body,
.portal-list-row > .app-tile-body {
  min-width: 0;
}

.team-member-row .app-tile-body h4,
.catalogue-collection-card .app-tile-body h4,
.booking-board-card .app-tile-body h4,
.api-key-row .app-tile-body h4,
.portal-list-row .app-tile-body h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.team-member-actions,
.catalogue-collection-card-actions,
.api-key-row .app-tile-actions,
.portal-list-row .app-tile-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0;
}

.team-member-actions .secondary-btn,
.team-member-actions .primary-btn,
.catalogue-collection-card-actions .secondary-btn,
.api-key-row .secondary-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-width: 3.4rem;
  min-height: 0;
  width: auto;
  max-width: none;
  padding: 0.38rem 0.85rem;
  background: rgba(18, 18, 18, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: none;
}

.team-member-actions .secondary-btn:hover,
.catalogue-collection-card-actions .secondary-btn:hover,
.api-key-row .secondary-btn:hover {
  background: rgba(18, 18, 18, 0.1);
}

.team-member-actions .primary-btn {
  background: var(--ink);
  color: #fff;
}

.team-member-actions .danger-btn,
.catalogue-collection-card-actions .danger-btn,
.api-key-row .danger-btn {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
}

.team-member-editor {
  grid-column: 1 / -1;
}
