/* ==========================================================================
   APARTADO "MI RED": GESTIÓN DE ECOSISTEMA B2B
   ========================================================================== */

/* Contenedor Principal (Layout a 2 columnas) */
.network-container {
  display: flex;
  gap: 24px;
  max-width: 1128px;
  margin: 24px auto;
  padding: 0 16px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ================= BARRA DE BÚSQUEDA ================= */
.network-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background-color: #ffffff;
  border: 1px solid #dde7f1;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  color: #788fa5;
}

.network-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: #333333;
  font-family: inherit;
}

.network-search-bar input::placeholder {
  color: #94a3b8;
}

/* ================= BARRA LATERAL IZQUIERDA ================= */
.network-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.network-manage-card {
  padding: 12px 0;
  background-color: #ffffff;
  border: 1px solid #dde7f1;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.network-sidebar-title {
  padding: 0 16px 12px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
  border-bottom: 1px solid #dde7f1;
}

/* Menú de categorías */
.network-menu-list {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.network-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: #56687a;
  transition: background-color 0.2s ease;
}

.network-menu-item:hover {
  background-color: #f0f2f5;
}

/* Estado activo del menú (Ej: Alianzas y Contactos) */
.network-menu-item.active {
  border-left: 4px solid #56687a;
  background-color: #edf4fc;
  color: #333333;
}

.menu-icon {
  font-size: 1.2rem;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.menu-label {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.menu-count {
  font-weight: 400;
  color: #788fa5;
  font-size: 0.9rem;
}

/* ================= PANEL CENTRAL ================= */
.network-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 1. SECCIÓN DE SOLICITUDES */
.requests-card {
  background-color: #ffffff;
  border: 1px solid #dde7f1;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
}

.see-all-link {
  color: #56687a;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.see-all-link:hover {
  background-color: #f0f2f5;
}

/* Ítem de Solicitud individual */
.request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid #dde7f1;
}

.request-item:first-child {
  border-top: none;
  padding-top: 8px;
}

.request-entity-info {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
}

/* Avatar cuadrado con bordes suaves (Estilo Institucional) */
.request-avatar {
  width: 72px;
  height: 72px;
  margin: 0;
  flex-shrink: 0;
}

.request-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dde7f1;
}

.request-text h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
}

.request-headline {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: #56687a;
  line-height: 1.3;
}

.request-context-note {
  margin: 0;
  font-size: 0.8rem;
  color: #56687a;
  background-color: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
  border: 1px solid #e7e2dc;
}

/* Botones de acción en la solicitud */
.request-actions {
  display: flex;
  gap: 12px;
  margin-left: 20px;
}

.btn-action-secondary {
  background: none;
  border: none;
  color: #788fa5;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.btn-action-secondary:hover {
  background-color: #f0f2f5;
  color: #56687a;
}

.btn-primary-outline {
  background-color: transparent;
  border: 1px solid #56687a;
  color: #56687a;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 20px;
  transition: all 0.2s;
}

.btn-primary-outline:hover {
  background-color: #56687a;
  color: #ffffff;
}

/* 2. SECCIÓN DE SUGERENCIAS (GRID) */
.suggestions-main-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin: 0 0 16px 0;
}

.suggestions-grid {
  display: grid;
  /* Auto-fill crea columnas dinámicas que nunca serán más pequeñas de 220px */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.entity-suggestion-card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #dde7f1;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: box-shadow 0.2s;
}

.entity-suggestion-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Cabecera y logo superpuesto para las tarjetas grid */
.suggestion-banner {
  height: 64px;
  background-color: #c0d1e2; /* Color corporativo de fondo */
  margin: 0;
}

.suggestion-body {
  padding: 0 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -36px; /* Sube el contenido para pisar el banner */
}

.suggestion-logo {
  width: 72px;
  height: 72px;
  margin: 0 0 12px 0;
  background-color: #ffffff;
  border-radius: 8px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suggestion-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.suggestion-entity-name {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
}

.suggestion-entity-desc {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #788fa5;
  /* Trunca el texto a exactamente 2 líneas para mantener la altura de las tarjetas igual */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.suggestion-mutual-meta {
  margin: auto 0 0 0;
  font-size: 0.75rem;
  color: #56687a;
  background-color: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
}

.suggestion-footer {
  padding: 16px;
  border-top: 1px solid #f0f2f5;
}

.btn-full-width {
  width: 100%;
  padding: 8px 0;
  border-radius: 20px;
}


/* ==========================================================================
   RESPONSIVE DESIGN (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 768px) {

  .network-container {
    flex-direction: column;
    padding: 0 10px;
    margin: 16px auto;
  }

  .network-sidebar {
    width: 100%;
  }

  /* Ajustar las solicitudes para móvil (apilar contenido y botones) */
  .request-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .request-actions {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: stretch;
  }

  .request-actions button {
    flex: 1; /* Hace que los botones de Aceptar/Ignorar ocupen 50% cada uno */
    text-align: center;
    padding: 10px 0;
  }

  /* Reducir el tamaño mínimo de la tarjeta en el Grid para que quepan 2 por fila en móvil si es posible */
  .suggestions-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}