/**
 * team.css — Team management page styles
 */

/* ── Page Layout ────────────────────────────────────────────────── */

.team-section {
  max-width: 800px;
  margin-inline: auto;
  padding: 2rem 1rem 4rem;
}

/* ── Header ─────────────────────────────────────────────────────── */

.team-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.75rem;
}

.team-header__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--color-text, #1a2040);
  line-height: 1.2;
}

.team-header__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted, #5a6080);
}

/* ── Tier Gate ───────────────────────────────────────────────────── */

.team-gate {
  padding: 1.5rem;
  border: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 10%, white));
  border-radius: var(--radius-xl, 1.25rem);
  background: var(--glass-bg-strong, rgb(255 255 255 / 76%));
  text-align: center;
  margin-block-end: 1.5rem;
}

.team-gate__text {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted, #5a6080);
}

/* ── Seat Quota ──────────────────────────────────────────────────── */

.team-quota {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block-end: 1.5rem;
}

.team-quota__label {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted, #5a6080);
  white-space: nowrap;
}

.team-quota__bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full, 999px);
  background: var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 10%, white));
  overflow: hidden;
}

.team-quota__fill {
  height: 100%;
  border-radius: var(--radius-full, 999px);
  background: var(--gem-sapphire-flat, #1f3a99);
  transition: width 400ms ease;
}

/* ── Cards ───────────────────────────────────────────────────────── */

.team-card {
  padding: 1.75rem;
  border: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 10%, white));
  border-radius: var(--radius-xl, 1.25rem);
  background: var(--glass-bg-strong, rgb(255 255 255 / 76%));
  backdrop-filter: blur(8px);
  margin-block-end: 1.25rem;
}

.team-card--subdued {
  background: var(--glass-bg, rgb(255 255 255 / 50%));
}

.team-card__title {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #1a2040);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-card__count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted, #5a6080);
}

/* ── Invite Form ─────────────────────────────────────────────────── */

.invite-form__row {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-block-end: 1rem;
}

.invite-form__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text, #1a2040);
}

.invite-form__input,
.invite-form__select {
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 15%, white));
  border-radius: var(--radius-md, 0.5rem);
  font-size: 0.9rem;
  color: var(--color-text, #1a2040);
  background: #fff;
  width: 100%;
  transition: border-color 200ms;
}

.invite-form__input:focus,
.invite-form__select:focus {
  outline: 2px solid var(--gem-sapphire-flat, #1f3a99);
  outline-offset: 1px;
  border-color: var(--gem-sapphire-flat, #1f3a99);
}

.invite-form__error {
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md, 0.5rem);
  background: color-mix(in srgb, var(--gem-ruby-flat, #a31b1b) 8%, white);
  border: 1px solid color-mix(in srgb, var(--gem-ruby-flat, #a31b1b) 25%, white);
  font-size: 0.85rem;
  color: var(--gem-ruby-flat, #a31b1b);
}

.invite-form__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.invite-form__hint {
  font-size: 0.82rem;
  color: var(--color-text-muted, #5a6080);
}

/* ── Member Table ────────────────────────────────────────────────── */

.member-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.member-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #5a6080);
  border-block-end: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 10%, white));
}

.member-table td {
  padding: 0.75rem;
  color: var(--color-text, #1a2040);
  border-block-end: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 7%, white));
  vertical-align: middle;
}

.member-table tr:last-child td {
  border-block-end: none;
}

.member-table__email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.member-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full, 999px);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.member-tag--you {
  background: color-mix(in srgb, var(--gem-sapphire-flat, #1f3a99) 10%, white);
  color: var(--gem-sapphire-flat, #1f3a99);
}

.member-role-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 15%, white));
  border-radius: var(--radius-sm, 0.25rem);
  font-size: 0.85rem;
  color: var(--color-text, #1a2040);
  background: #fff;
}

.member-role-label {
  color: var(--color-text-muted, #5a6080);
  font-size: 0.87rem;
}

.member-table__actions {
  text-align: right;
}

/* ── Invite Status ───────────────────────────────────────────────── */

.invite-status {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full, 999px);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invite-status--pending {
  background: color-mix(in srgb, var(--gem-gold-native-flat, #c88c00) 12%, white);
  color: var(--gem-gold-native-flat, #c88c00);
}

/* ── Empty + Skeleton ────────────────────────────────────────────── */

.team-empty {
  margin: 0;
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted, #5a6080);
}

.team-skeleton {
  display: grid;
  gap: 0.75rem;
}

.team-skeleton__row {
  height: 2.5rem;
  border-radius: var(--radius-md, 0.5rem);
  background: var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 8%, white));
}

/* ── Audit List ──────────────────────────────────────────────────── */

.audit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.audit-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-block-end: 1px solid var(--border-subtle, color-mix(in srgb, var(--gem-labradorite-flat, #2d3f6e) 6%, white));
  font-size: 0.85rem;
}

.audit-list__item:last-child {
  border-block-end: none;
}

.audit-list__action {
  color: var(--color-text, #1a2040);
}

.audit-list__date {
  font-size: 0.8rem;
  color: var(--color-text-muted, #5a6080);
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (width <= 600px) {
  .team-header {
    flex-direction: column;
  }

  .team-quota {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-quota__bar {
    width: 100%;
  }

  .member-table th:last-child,
  .member-table td:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-quota__fill {
    transition: none;
  }
}
