:root {
  --users-primary: #0284c7;
  --users-primary-dark: #0369a1;
  --users-primary-light: #38bdf8;
  --users-primary-glow: rgba(2, 132, 199, 0.22);
  --users-success: #10b981;
  --users-warning: #f59e0b;
  --users-danger: #ef4444;
  --users-bg: #f8fafc;
  --users-card: #ffffff;
  --users-text-main: #0f172a;
  --users-text-muted: #475569;
  --users-text-subtle: #64748b;
  --users-border: #e2e8f0;
  --users-border-hover: #38bdf8;
  --users-radius-sm: 10px;
  --users-radius-md: 16px;
  --users-radius-lg: 22px;
  --users-radius-xl: 28px;
  --users-radius-full: 9999px;
  --users-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --users-shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03);
  --users-shadow-lg: 0 16px 36px -6px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.03);
  --users-shadow-hover: 0 16px 36px -6px rgba(2, 132, 199, 0.16), 0 0 0 1px rgba(2, 132, 199, 0.12);
}
.users-main {
  width: min(100% - 40px, 1260px);
  margin: 32px auto 60px;
  animation: usersFadeIn 0.35s ease-out;
}
@keyframes usersFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.users-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(240, 249, 255, 0.96) 100%);
  border: 1px solid var(--users-border);
  border-radius: var(--users-radius-xl);
  padding: 32px 36px;
  margin-bottom: 30px;
  box-shadow: var(--users-shadow-md);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.users-hero::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.users-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.users-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--users-radius-full);
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: var(--users-primary-dark);
  font-family: var(--font-display, inherit);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.users-hero-badge i {
  color: var(--users-primary);
  font-size: 13px;
}
.users-hero-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.users-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--users-text-subtle);
  background: #ffffff;
  padding: 5px 14px;
  border-radius: var(--users-radius-full);
  border: 1px solid var(--users-border);
  box-shadow: var(--users-shadow-sm);
}
.users-stat-pill.online-pill i {
  color: #10b981;
}
.users-stat-pill.friends-pill i {
  color: #0284c7;
}
.users-stat-pill.requests-pill i {
  color: #f59e0b;
}
.users-hero h1 {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 32px;
  font-weight: 800;
  color: var(--users-text-main);
  letter-spacing: -0.6px;
  line-height: 1.2;
}
.users-hero h1 .highlight-text {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.users-hero p {
  margin: 0;
  color: var(--users-text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 820px;
}
.users-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 38px;
}
.users-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding: 0 20px;
  border: 1.5px solid var(--users-border);
  border-radius: var(--users-radius-lg);
  color: var(--users-text-muted);
  background: #ffffff;
  box-shadow: var(--users-shadow-sm);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.users-search:focus-within {
  border-color: var(--users-primary);
  box-shadow: 0 0 0 4px var(--users-primary-glow), var(--users-shadow-md);
  transform: translateY(-1px);
}
.users-search i.search-icon {
  font-size: 18px;
  color: #94a3b8;
  transition: color 0.2s ease;
}
.users-search:focus-within i.search-icon {
  color: var(--users-primary);
}
.users-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--users-text-main);
  background: transparent;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 500;
}
.users-search input::placeholder {
  color: #94a3b8;
}
.users-search-clear {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.users-search-clear:hover {
  color: #0f172a;
  background: #f1f5f9;
}
.users-search-clear[hidden] {
  display: none !important;
}
.users-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  user-select: none;
}
.users-mobile-tabs {
  display: none;
  align-items: center;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--users-border);
  gap: 4px;
  overflow-x: auto;
}
.mobile-tab-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--users-text-muted);
  font-family: var(--font-display, inherit);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mobile-tab-btn.active {
  background: #ffffff;
  color: var(--users-primary-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.mobile-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
}
.mobile-tab-btn.active .mobile-tab-badge.friends-bg { background: #e0f2fe; color: #0369a1; }
.mobile-tab-btn.active .mobile-tab-badge.requests-bg { background: #fef3c7; color: #b45309; }
.mobile-tab-btn.active .mobile-tab-badge.suggestions-bg { background: #e0f2fe; color: #0369a1; }
.users-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}
.user-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 580px;
  padding: 24px 22px;
  border-radius: var(--users-radius-xl);
  background: var(--users-card);
  border: 1px solid var(--users-border);
  box-shadow: var(--users-shadow-sm);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-card:hover {
  border-color: rgba(2, 132, 199, 0.3);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(15, 23, 42, 0.02);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.card-header-icon.friends-icon { background: #e0f2fe; color: #0284c7; }
.card-header-icon.requests-icon { background: #fef3c7; color: #d97706; }
.card-header-icon.suggestions-icon { background: #f0fdf4; color: #10b981; }
.card-header h2 {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 18px;
  font-weight: 800;
  color: var(--users-text-main);
  letter-spacing: -0.3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--users-radius-full);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}
.badge-blue {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.badge-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.card-list-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#friendsList,
#requestsList,
#suggestionsList {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}
.user-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--users-radius-md);
  background: #ffffff;
  border: 1px solid var(--users-border);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.user-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--users-shadow-sm);
}
.avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}
.avatar-wrap .avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-initial {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  font-family: var(--font-display, inherit);
  font-size: 17px;
  font-weight: 800;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-wrap .online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  z-index: 2;
  transition: all 0.25s ease;
}
.avatar-wrap .online-dot.is-online {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulseDot 2s infinite ease-in-out;
}
.avatar-wrap .online-dot.is-offline {
  background: #94a3b8;
  opacity: 0.75;
}
@keyframes pulseDot {
  0% { transform: scale(1); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4); }
}
.user-info {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.user-info h3 {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--users-text-main);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-info p {
  margin: 2px 0 0;
  color: var(--users-text-subtle);
  font-size: 11.5px;
  font-weight: 500;
}
.user-status-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 2px;
  line-height: 1;
}
.user-status-text.is-online {
  color: #059669;
  font-weight: 600;
}
.user-status-text.is-offline {
  color: #64748b;
}
.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}
.status-indicator-dot.offline {
  background: #94a3b8;
}
.btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.action-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.action-btn:hover {
  transform: translateY(-2px);
}
.btn-friends {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}
.btn-friends:hover {
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}
.btn-remove {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-remove:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.btn-accept {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}
.btn-accept:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}
.btn-decline {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--users-border);
}
.btn-decline:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-requested {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.12);
}
.btn-requested:hover {
  background: #fde68a;
  color: #92400e;
}
.btn-add {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}
.btn-add:hover {
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}
.users-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--users-text-subtle);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  padding: 40px 16px;
  min-height: 240px;
  height: 100%;
  width: 100%;
  user-select: none;
  gap: 10px;
  background: #fafafa;
  border: 1.5px dashed #e2e8f0;
  border-radius: var(--users-radius-lg);
}
.users-message i {
  font-size: 32px;
  color: #cbd5e1;
}
.card-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
}
.card-pagination[hidden] {
  display: none !important;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--users-border);
  background: #ffffff;
  color: var(--users-text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--users-shadow-sm);
}
.page-btn:hover:not(:disabled) {
  background: #f8fafc;
  color: var(--users-primary);
  border-color: var(--users-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.page-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--users-text-subtle);
  letter-spacing: 0.3px;
  user-select: none;
}
.modal-backdrop {
  position: fixed;
  z-index: 1050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: modalFadeIn 0.22s ease-out;
}
.modal-backdrop[hidden] {
  display: none !important;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirmation-modal {
  position: relative;
  width: min(100%, 420px);
  padding: 34px 30px;
  border: 1px solid var(--users-border);
  border-radius: var(--users-radius-xl);
  text-align: center;
  background: #ffffff;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  animation: modalScaleUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #fef3c7;
  color: #d97706;
}
.modal-icon-danger {
  background: #fee2e2;
  color: #dc2626;
}
.confirmation-modal h2 {
  margin: 0 0 8px;
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 800;
  color: var(--users-text-main);
  letter-spacing: -0.3px;
}
.confirmation-modal p {
  margin: 0 0 24px;
  color: var(--users-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-button {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--users-radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-secondary {
  background: #f1f5f9;
  border: 1px solid var(--users-border);
  color: var(--users-text-main);
}
.modal-secondary:hover {
  background: #e2e8f0;
}
.modal-danger {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.modal-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}
.modal-danger-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.modal-danger-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  color: #64748b;
  background: #f1f5f9;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
@media (max-width: 1080px) {
  .users-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
@media (max-width: 900px) {
  .users-mobile-tabs {
    display: flex;
  }
  .users-grid[data-active-tab="friends"] #cardRequests,
  .users-grid[data-active-tab="friends"] #cardSuggestions {
    display: none;
  }
  .users-grid[data-active-tab="requests"] #cardFriends,
  .users-grid[data-active-tab="requests"] #cardSuggestions {
    display: none;
  }
  .users-grid[data-active-tab="suggestions"] #cardFriends,
  .users-grid[data-active-tab="suggestions"] #cardRequests {
    display: none;
  }
}
@media (max-width: 580px) {
  .users-main {
    width: min(100% - 24px, 1260px);
    margin: 16px auto 40px;
  }
  .users-hero {
    padding: 20px 16px;
    border-radius: var(--users-radius-lg);
    margin-bottom: 20px;
  }
  .users-hero h1 {
    font-size: 22px;
  }
  .users-controls {
    margin-bottom: 24px;
  }
  .user-card {
    padding: 16px 14px;
    border-radius: var(--users-radius-lg);
  }
  .user-item {
    padding: 10px 12px;
    gap: 8px;
  }
  .btn-group {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .action-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
  }
}
@media (max-width: 360px) {
  .users-main {
    width: min(100% - 16px, 1260px);
  }
  .user-item {
    flex-wrap: wrap;
  }
  .btn-group {
    width: 100%;
    margin-left: 54px;
    justify-content: flex-start;
  }
}
