/* teams.css — the Teams page: master list on the left, open team on the right.
   Uses the existing TSN Pulse tokens, so both themes work without a second
   palette. No external fonts or assets. */

.tm-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 860px) {
  .tm-layout { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ list */
.tm-list-card { padding: 0; overflow: hidden; }

.tm-list-head {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.tm-list-head input { width: 100%; }

.tm-list { max-height: 62vh; overflow-y: auto; }

.tm-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tm-item:last-child { border-bottom: 0; }
.tm-item:hover { background: var(--hover); }

.tm-item.on {
  border-left-color: var(--blue);
  background: rgba(47, 180, 240, 0.07);
}

.tm-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.tm-item-name { font-weight: 600; color: var(--text); }

.tm-count {
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tm-item-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.tm-empty { padding: 1.4rem 0.9rem; text-align: center; }

/* ---------------------------------------------------------------- detail */
.tm-detail-card { min-height: 18rem; }

.tm-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.tm-title { margin: 0; font-size: 1.15rem; color: var(--text); text-transform: none;
            letter-spacing: 0; }

.tm-tools { display: flex; gap: 0.35rem; }

.tm-leadrow {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.8rem 0 0.2rem;
}

.tm-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tm-leadname { color: var(--text); font-weight: 600; }
.tm-nolead { color: var(--muted); font-style: italic; }

.tm-lead-tag {
  display: inline-block;
  padding: 0.04rem 0.4rem;
  border-radius: 999px;
  background: rgba(47, 180, 240, 0.14);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tm-section-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1.2rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- members */
.tm-members { display: flex; flex-direction: column; }

.tm-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0.1rem;
  border-bottom: 1px solid var(--border);
}

.tm-member:last-child { border-bottom: 0; }

.tm-who { min-width: 0; }

.tm-who-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 500;
}

.tm-who-sub {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-member-acts {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.tm-star {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
}

.tm-star:hover { border-color: var(--border); color: var(--text); }
.tm-star.on { color: var(--blue); }

.tm-remove { opacity: 0; transition: opacity 0.12s ease; }
.tm-member:hover .tm-remove,
.tm-remove:focus { opacity: 1; }

/* ------------------------------------------------------------ add member */
.tm-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.tm-add select { flex: 1 1 auto; min-width: 0; }
.tm-add button { flex: 0 0 auto; }

/* ---------------------------------------------------- invites + bulk import */
.inv-modal { width: min(620px, 96vw); }

.inv-tools { gap: 0.4rem; }
.inv-tools input { flex: 1 1 auto; min-width: 0; }

.inv-list {
  max-height: 46vh;
  overflow-y: auto;
  margin: 0.6rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.inv-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.inv-row:last-child { border-bottom: 0; }
.inv-row:hover { background: var(--hover); }
.inv-row input { flex: 0 0 auto; }

.inv-who { display: flex; flex-direction: column; min-width: 0; }
.inv-name { color: var(--text); }
.inv-email { color: var(--muted); font-size: 0.78rem; }

.inv-foot { align-items: center; gap: 0.6rem; }

.inv-result { margin-top: 0.9rem; }

.inv-block {
  max-height: 40vh;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre;
  user-select: all;
}

.imp-result { margin-top: 0.8rem; }
.imp-result table { width: 100%; }
.imp-skipped { margin-top: 0.6rem; }
.imp-skipped > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
