/* ===========================================================================
   Team
   ---------------------------------------------------------------------------
   A card per person rather than a row, because what matters about a colleague
   here is whether their connections are healthy — a broken mailbox stops their
   outreach entirely, and that is a state worth a panel rather than a cell.
   =========================================================================== */

/* The containers of the company drawer's Overview (.ovbox): 16px radius, a
   faint edge, the softest shadow. Each card is a column, so the figures sit
   on its floor and line up across a row whatever is above them. */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px }
.member {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid rgba(16, 33, 31, .07); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 33, 31, .04);
  padding: 22px 24px; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text); transition: border-color .16s ease;
}
.member:hover { border-color: rgba(16, 33, 31, .28) }
/* The name is the card's button (no control inside a control): its focus
   ring is drawn round the whole card, which is what it opens. */
.member:has(.member__name:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px }

/* The action inside a blocked notice.
   A plain white pill rather than a solid red one: the panel behind it is
   already carrying the alarm, and a second red on top of the first was louder
   than the problem it described. Only the spacing is set here — everything
   else comes from .btn so it matches every other button in the app. */
.member__blocked .btn { margin-top: 10px }
.member__top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px }
.member__name {
  display: block; max-width: 100%; padding: 0; margin: 0; border: 0; background: none;
  font-family: inherit; line-height: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.member__name:focus-visible { outline: none }
.member__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: var(--weight-strong) }
.member__role { font-size: 12.5px; color: var(--muted) }
/* An admin's role beside the title: the shield and the word, in ink, so it
   reads apart from the muted title without becoming a tag. */
.member__admin { display: inline-flex; align-items: center; gap: 3px; vertical-align: bottom; color: var(--ink); font-weight: 500 }
.member__admin .ms { font-size: 15px }
/* Deactivated (team-002): the same mark-and-word as Admin, in red, and the
   card's channels and figures fade, since none of them is working for anyone. */
.member__off { color: var(--bad) }
.member--off .member__link, .member--off .member__stats { opacity: .45 }

/* Something is wrong and this person cannot send until it is fixed. */
.member__blocked {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  background: #FCEBE8; border: 1px solid #E9A9A2; border-radius: 14px;
  padding: 13px 15px; margin-bottom: 16px;
}
.member__blocked .ms { font-size: 18px; color: #C0362C }
/* The mark sits level with the headline, not halfway down to the action
   under it, and is as wide as the channel marks below, so the headline
   starts where their names do. */
.member__blocked { align-items: flex-start; gap: 12px }
.member__blocked > .ms { width: 18px; line-height: 18px }
.member__blocked b { display: block; font-size: 12.5px; line-height: 18px; font-weight: var(--weight-strong); color: #8E1D15 }

.member__link {
  display: flex; align-items: center; gap: 12px;
  background: var(--page); border-radius: 12px; padding: 11px 14px;
}
.member__link .ms { font-size: 18px; color: var(--teal) }
.member__link--bad { background: #FCEBE8 }
.member__link--bad .ms { color: #C0362C }
.member__chan { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto }
.member__dot {
  position: absolute; right: -3px; bottom: -2px; width: 9px; height: 9px;
  border-radius: var(--r-pill); background: var(--good, #1F9D5B); box-shadow: 0 0 0 2px var(--page);
}
.member__dot--bad { background: #C0362C; box-shadow: 0 0 0 2px #FCEBE8 }
/* An optional channel nobody has connected: present, but quiet. */
.member__link--off .member__chan { filter: grayscale(1); opacity: .45 }
.member__link--off > span:nth-child(2) { color: var(--muted) }
/* A row's one action, at its end: a small text action with a mark, not a pill,
   so a row with one stands no taller than a row without. The hit area is
   padded out past the text and pulled back with negative margins, so it is
   comfortable to tap without pushing the rows apart. */
.member__act {
  flex: 0 0 auto; margin: -6px -12px -6px auto; padding: 0 12px; min-height: 32px;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; border-radius: var(--r-btn-sm); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: var(--weight-strong); white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.member__act .ms { font-size: 16px; color: inherit }
/* Row-action size (design/corners-and-spacing.md, "Buttons"): 32 tall, 12 / 8. */
.member__act:has(> .ms:first-child) { padding-left: 8px }
.member__act:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px }
.member__act:active { transform: translateY(1px) }
/* Connect, link, repair: the app's action colour, deepened for contrast. */
.member__act--go { color: color-mix(in srgb, var(--teal) 62%, var(--ink)) }
.member__act--go:hover { background: color-mix(in srgb, var(--teal) 12%, transparent) }
/* Connecting: the account is done at Unipile and on its way here. Not a
   button, so no hover; the mark turns until the row lands. */
.member__act--wait { color: color-mix(in srgb, var(--teal) 62%, var(--ink)); cursor: default }
.member__act--wait .ms, .statemark--wait .ms { animation: cdSpin 1s linear infinite }
@media (prefers-reduced-motion: reduce) {
  .member__act--wait .ms, .statemark--wait .ms { animation: none }
}
/* Unlink: quiet beside a working account, red once pointed at. */
.member__act--off { color: var(--muted) }
.member__act--off:hover, .member__act--off:focus-visible { color: var(--bad); background: #FCEBE8 }
.member__link > span:nth-child(2) {
  flex: 1; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Three figures in equal columns split by hairlines (the drawer's Contact
   methods): a number over its label, nothing else. */
.member__stats {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); margin-top: auto;
}
.member__stats > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 2px 18px }
.member__stats > div:first-child { padding-left: 0 }
.member__stats > div:last-child { padding-right: 0 }
.member__stats > div + div { border-left: 1px solid var(--hair) }
.member__stat { display: inline-flex; align-items: baseline; gap: 2px }
.member__stat b { font-size: 20px; line-height: 1.2; font-weight: var(--weight-strong); font-variant-numeric: tabular-nums }
.member__stats .figcap { text-wrap: balance }
.member__of { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums }

/* A viewer's card: what a rep's card spends on channels and figures holds
   the seat instead, centred in the space under the name and the Claude row
   (the one account a viewer connects), so the card reads as view only at a
   glance and stands as tall as the cards beside it. In the flow rather than
   laid over the card, so on a short card it can never sit on that row. */
.member--viewer { min-height: 320px }
.member__viewonly {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center;
}
.member__viewonly .ms { font-size: 44px; color: color-mix(in srgb, var(--teal) 62%, var(--ink)); margin-bottom: 8px }
.member__viewonly b { font-size: 17px; font-weight: var(--weight-strong); color: var(--ink) }
.member__viewonly span:not(.ms) { font-size: 12.5px; font-weight: 500; color: var(--muted) }

/* Stretches to the height of the member cards beside it in the row. */
.member--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 0; padding: 22px; border: 1px dashed var(--teal); border-radius: 16px;
  background: var(--page); cursor: pointer; color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: var(--weight-strong);
}
.member--add:hover { border-color: var(--ink) }
.member--add .ms { font-size: 26px }

.invrow { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hair) }
.invrow__mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--r-pill);
  background: var(--page); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: var(--weight-strong);
}
