.page-servers {
  padding: 18px 0 40px;
}

.page-servers .is-hidden {
  display: none !important;
}

.servers-hero {
  padding: 30px;
  margin-bottom: 18px;
}

.servers-hero__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.servers-toolbar {
  padding: 18px;
  margin-bottom: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.servers-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f3efe6;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active {
  background: #efe3c8;
  color: #2d3339;
  border-color: transparent;
}

.search-box {
  min-width: min(100%, 360px);
  height: 48px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.search-box__icon {
  width: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c9c1b3;
  font-size: 18px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
}

.search-box input::placeholder {
  color: #a6b0b8;
}

.servers-skeleton,
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.servers-grid.is-grid-loading .server-card {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.server-card {
  position: relative;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, #33404a 0%, #2e3740 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(31, 36, 41, 0.16);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
  transition: transform 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.server-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.14);
}

.server-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.server-card__identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.server-card__icon {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}

.server-card__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #fff8ef;
  line-height: 1.1;
}

.server-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-card__description {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.6;
  min-height: 72px;
}

.role-badge,
.bot-badge {
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.role-badge--owner {
  background: rgba(239, 227, 200, 0.14);
  color: #f3e5c9;
  border-color: rgba(239, 227, 200, 0.18);
}

.role-badge--admin {
  background: rgba(171, 201, 255, 0.12);
  color: #dbe8ff;
  border-color: rgba(171, 201, 255, 0.18);
}

.role-badge--member {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e1d8;
  border-color: rgba(255, 255, 255, 0.08);
}

.bot-badge--online {
  background: rgba(158, 214, 163, 0.12);
  color: #d8f4da;
  border-color: rgba(158, 214, 163, 0.18);
}

.bot-badge--missing {
  background: rgba(255, 196, 112, 0.12);
  color: #ffe2b6;
  border-color: rgba(255, 196, 112, 0.18);
}

.server-card__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: auto;
}

.card-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.card-btn--primary {
  background: #efe3c8;
  color: #2d3339;
  border-color: transparent;
}

.card-btn--ghost {
  background: rgba(255, 255, 255, 0.035);
  color: #f3efe6;
}

.card-btn--invite {
  background: rgba(239, 227, 200, 0.1);
  color: #f3e5c9;
  border-color: rgba(239, 227, 200, 0.18);
}

.card-btn--disabled {
  background: rgba(255, 255, 255, 0.035);
  color: #9ea7af;
  cursor: not-allowed;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3efe6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 21px;
  line-height: 1;
}

.server-card.is-appear {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  animation: serverCardIn 0.55s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes serverCardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.server-card--skeleton {
  min-height: 260px;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.2s infinite linear;
  border-radius: 14px;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-avatar {
  width: 68px;
  height: 68px;
  border-radius: 22px;
}

.skeleton-line {
  height: 16px;
  width: 100%;
}

.skeleton-line--lg {
  height: 20px;
  width: 70%;
}

.skeleton-line--sm {
  width: 40%;
}

.skeleton-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.skeleton-btn {
  height: 48px;
  width: 100%;
}

.skeleton-btn--sm {
  width: 120px;
}

.empty-state {
  margin-top: 18px;
  padding: 30px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 10px;
  color: #fff8ef;
}

.empty-state p {
  margin: 0;
  color: #c9c1b3;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 24, 29, 0.62);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
  z-index: 200;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.invite-modal {
  width: min(100%, 560px);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, #36414b 0%, #2f3841 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  position: relative;
  transform: translateY(10px) scale(0.98);
  transition: 0.22s ease;
}

.modal-backdrop.is-open .invite-modal {
  transform: translateY(0) scale(1);
}

.invite-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.invite-modal__top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.invite-modal__title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
  color: #fff8ef;
}

.invite-modal__text {
  margin: 0;
  color: #c9c1b3;
  line-height: 1.6;
}

.invite-modal__box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.invite-modal__label {
  display: block;
  margin-bottom: 10px;
  color: #c9c1b3;
  font-size: 0.92rem;
}

.invite-modal__link-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.invite-modal__input {
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.copy-btn {
  min-width: 120px;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.invite-modal__actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .servers-toolbar {
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .servers-hero,
  .servers-toolbar,
  .server-card,
  .invite-modal {
    padding: 20px;
  }

  .server-card__actions,
  .invite-modal__link-wrap,
  .skeleton-actions {
    grid-template-columns: 1fr;
  }
}