/* Основная зона страницы команды */
.team-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg);
}

/* Шапка страницы */
.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.team-header__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: -0.3px;
}

.team-header__sub {
  font-size: 13px;
  color: var(--text-on-dark-2);
  margin-top: 4px;
}

/* Кнопка «Пригласить» */
.team-invite-btn {
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.team-invite-btn:hover { opacity: .88; }

/* Список участников */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Карточка участника */
.member-card {
  background: var(--bg-mid);
  border: 1px solid #2e3342;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition);
}

.member-card:hover { border-color: #3e4558; }

.member-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Аватар — буква */
.member-card__avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.member-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-card__avatar svg {
  width: 60%;
  height: 60%;
  opacity: 0.9;
}

.member-card__info {
  flex: 1;
  min-width: 0;
}

.member-card__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-card__edit {
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 6px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  vertical-align: baseline;
}
.member-card__edit:hover {
  opacity: 1;
}

.member-card__email {
  font-size: 12px;
  color: var(--text-on-dark-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Роль */
.member-card__role {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #232a3f;
  color: var(--accent);
  flex-shrink: 0;
}

/* Статус */
.member-card__status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.member-card__status.pending {
  background: #2e2510;
  color: #e07030;
}

.member-card__status.active {
  background: #0f2a1e;
  color: var(--green);
}

/* Дата */
.member-card__date {
  font-size: 12px;
  color: var(--text-on-dark-2);
  flex-shrink: 0;
}

/* Кнопки действий */
.member-card__actions {
  display: flex;
  gap: 8px;
}

.member-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition);
  border: none;
}

.member-btn--ghost {
  background: #2e3342;
  color: var(--text-on-dark);
}

.member-btn--ghost:hover { background: #3a4054; }

.member-btn--danger {
  background: rgba(255, 107, 107, .12);
  color: var(--red);
}

.member-btn--danger:hover { background: rgba(255, 107, 107, .22); }

.member-btn:disabled { opacity: .45; cursor: default; }

/* Пустое состояние */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-on-dark-2);
}

.empty-state__icon { font-size: 36px; }
.empty-state__text { font-size: 14px; text-align: center; line-height: 1.6; }

/* Тост */
.lk-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-mid);
  border: 1px solid #2e3342;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-on-dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 300;
  white-space: nowrap;
}

.lk-toast.show { opacity: 1; }
.lk-toast.toast-error { background: #2a1010; border-color: #4a1e1e; color: var(--red); }

/* Модальные окна */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg-mid);
  border: 1px solid #2e3342;
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  margin: 16px;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #2e3342;
}

.modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-on-dark);
}

.modal__close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-on-dark-2);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal__close:hover { background: #2e3342; color: var(--text-on-dark); }

.modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-dark-2);
}

.modal__label-hint {
  font-weight: 400;
  color: var(--text-on-dark-2);
}

.modal__input,
.modal__select {
  height: 40px;
  padding: 0 12px;
  background: #13161f;
  border: 1px solid #2e3342;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.modal__input::placeholder { color: var(--text-on-dark-2); }
.modal__input:focus,
.modal__select:focus { border-color: var(--accent); }

.modal__select { cursor: pointer; }

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid #2e3342;
}

.modal__cancel {
  height: 38px;
  padding: 0 18px;
  border: 1px solid #2e3342;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-on-dark-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.modal__cancel:hover { border-color: #3e4558; color: var(--text-on-dark); }

.modal__submit {
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.modal__submit:hover    { opacity: .88; }
.modal__submit:disabled { opacity: .45; cursor: default; }

/* Панель фильтров */
.team-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.team-filters__search { flex: 1; min-width: 220px; padding: 10px 14px; background: var(--surface2, #22263a); border: 1px solid var(--border, #2e3248); border-radius: var(--radius-sm, 8px); color: var(--text, #e8eaf6); font-size: 14px; outline: none; }
.team-filters__search::placeholder { color: var(--text3, #555a7a); }
.team-filters__search:focus { border-color: var(--accent, #6c6fff); }
.team-filters__select { padding: 10px 14px; background: var(--surface2, #22263a); border: 1px solid var(--border, #2e3248); border-radius: var(--radius-sm, 8px); color: var(--text, #e8eaf6); font-size: 14px; outline: none; cursor: pointer; }
.team-filters__select:focus { border-color: var(--accent, #6c6fff); }


/* Цвет текста в фильтрах */
.team-filters__select { color: var(--text2, #8b90b8); }
.team-filters__select option { background: #1a1d27; color: #ffffff; }
.team-filters__select option:hover, .team-filters__select option:focus, .team-filters__select option:checked { background: #6c6fff; color: #ffffff; box-shadow: 0 0 10px 100px #6c6fff inset; }

/* Мобильная адаптация */
@media (max-width: 600px) {
  .team-main { padding: 16px; }

  .team-header { flex-wrap: wrap; gap: 12px; }
  .team-header__title { font-size: 18px; }

  .team-filters { gap: 8px; flex-wrap: wrap; }
  .team-filters__search { width: 100%; flex-basis: 100%; box-sizing: border-box; min-width: 0; }
  .team-filters__select { flex: 1; min-width: 0; }

  .member-card__main { flex-wrap: wrap; gap: 10px; }

  .member-card__info { min-width: 0; flex: 1 1 calc(100% - 64px); }

  .member-card__name { white-space: normal; word-break: break-word; }
  .member-card__email { white-space: normal; word-break: break-word; }

  .member-card__role,
  .member-card__status,
  .member-card__date { flex-shrink: 1; }

  .member-card__actions { flex-wrap: wrap; }
  .member-btn { flex: 1; text-align: center; }

  .lk-toast {
    white-space: normal;
    word-break: break-word;
    width: max-content;
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}

/* Заглушка блокировки раздела */
.team-lock { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 24px; text-align: center; }
.team-lock__close { position: absolute; top: 20px; right: 24px; width: 34px; height: 34px; border: none; background: var(--bg-mid); color: var(--text-on-dark-2); font-size: 15px; cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background var(--transition), color var(--transition); }
.team-lock__close:hover { background: #2e3342; color: var(--text-on-dark); }
.team-lock__icon { font-size: 44px; }
.team-lock__title { font-size: 17px; font-weight: 700; color: var(--text-on-dark); max-width: 440px; line-height: 1.5; }
.team-lock__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.team-lock__btn { height: 42px; padding: 0 24px; border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: opacity var(--transition), border-color var(--transition), color var(--transition); }
.team-lock__btn--primary { background: var(--gradient-brand); color: #fff; border: none; }
.team-lock__btn--primary:hover { opacity: .88; }
.team-lock__btn--ghost { background: transparent; border: 1px solid #2e3342; color: var(--text-on-dark-2); }
.team-lock__btn--ghost:hover { border-color: #3e4558; color: var(--text-on-dark); }
@media (max-width: 600px) { .team-lock__actions { flex-direction: column; width: 100%; max-width: 320px; } .team-lock__btn { width: 100%; } }
