/* ── FRIENDS (social layer) ───────────────────────────────────────────────── */
/* Incoming-requests count badge on the nav tab */
.nav-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: .62rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.nav-badge[hidden] { display: none; }

/* El label "Amigos" ocupa su propia fila y su línea llena todo el ancho, como
   los headers de Perfil / Panel Docente; el subtítulo va debajo. */
.friends-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.friends-title { flex: 1; min-width: 0; margin-bottom: 0; }
.friends-sub { font-size: .85rem; color: var(--text-3); margin: 0 0 26px; }
.friends-block { margin-bottom: 26px; }
.friends-block-title {
  font-size: .82rem; font-weight: 700; color: var(--text-1); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.friends-subhead {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); margin: 12px 0 6px;
}
.friends-subhead:first-child { margin-top: 0; }
.friends-empty { font-size: .8rem; color: var(--text-3); font-style: italic; padding: 4px 2px; }

/* Search */
.friends-search-input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: .88rem; color: var(--text-1);
  transition: border-color .15s;
}
.friends-search-input::placeholder { color: var(--text-3); }
.friends-search-input:focus { outline: none; border-color: var(--border-hi); }
.friends-search-results { margin-top: 8px; }

/* Generic friend / request / search row */
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.friend-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 2px solid var(--border); font-size: 1.1rem; overflow: hidden;
}
.friend-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.friend-name { font-size: .9rem; font-weight: 600; color: var(--text-1); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.friend-name-link { background: none; border: none; cursor: pointer; padding: 0; }
.friend-name-link:hover { color: var(--red); text-decoration: underline; }
.friend-pending { font-size: .72rem; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.friend-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.friend-btn {
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-size: .76rem; font-weight: 700; border: 1px solid transparent;
  transition: filter .15s, transform .1s, background .15s;
}
.friend-btn:active { transform: scale(.94); }
.friend-btn-accept { background: rgba(34,197,94,.14); color: var(--green); border-color: rgba(34,197,94,.3); }
.friend-btn-accept:hover { filter: brightness(1.12); }
.friend-btn-ghost { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.friend-btn-ghost:hover { background: var(--surface-1); color: var(--text-1); border-color: var(--border-hi); }

/* Leaderboard */
.friend-lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.friend-lb-row.is-self { border-color: rgba(212,160,23,.4); background: rgba(212,160,23,.06); }
.friend-lb-rank {
  flex-shrink: 0; width: 22px; text-align: center; font-size: .85rem; font-weight: 800; color: var(--text-3);
}
.friend-lb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.friend-lb-name {
  font-size: .9rem; font-weight: 600; color: var(--text-1); text-align: left;
  background: none; border: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.friend-lb-name { cursor: pointer; }
button.friend-lb-name:hover { color: var(--red); text-decoration: underline; }
.friend-lb-house { flex-shrink: 0; font-size: 1.05rem; }
.friend-lb-level { flex-shrink: 0; font-size: .74rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.friend-lb-pts { flex-shrink: 0; font-size: .82rem; font-weight: 800; color: var(--gold); white-space: nowrap; min-width: 56px; text-align: right; }

/* Achievement strip (hover shows label + description via title) */
.ach-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.ach-chip {
  font-size: .82rem; line-height: 1; cursor: help;
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--border);
}
.ach-chip-more { font-size: .64rem; font-weight: 800; color: var(--text-3); cursor: default; }

/* Activity feed */
.feed-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.feed-main { flex: 1; min-width: 0; }
.feed-text { font-size: .85rem; color: var(--text-1); line-height: 1.35; }
.feed-text strong { font-weight: 700; }
.feed-icon { margin-right: 2px; }
.feed-time { font-size: .7rem; color: var(--text-3); margin-top: 2px; }

/* Profile-view friend button */
.profile-friend-action { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.friend-state { font-size: .8rem; font-weight: 700; color: var(--text-2); }

