.organization-connection-requests {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 20px;
  background: rgba(247, 248, 255, 0.96);
}

.organization-connection-requests[hidden] {
  display: none;
}

.connection-requests-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.connection-requests-head h4 {
  margin: 6px 0 7px;
  font-size: 1.35rem;
}

.connection-requests-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-requests-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
  font-size: 0.84rem;
  font-weight: 850;
}

.connection-requests-message {
  margin: 17px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.09);
  line-height: 1.5;
}

.connection-requests-message.success {
  color: #17684e;
  background: rgba(23, 104, 78, 0.1);
}

.connection-requests-message.error {
  color: #a12d2d;
  background: rgba(190, 50, 50, 0.1);
}

.connection-requests-list {
  display: grid;
  gap: 15px;
  margin-top: 18px;
}

.connection-request-card,
.connection-requests-empty {
  padding: 18px;
  border: 1px solid rgba(25, 45, 75, 0.12);
  border-radius: 16px;
  background: #fff;
}

.connection-request-card {
  display: grid;
  gap: 15px;
}

.connection-request-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.connection-request-source {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.connection-request-card h5 {
  margin: 6px 0 4px;
  font-size: 1.15rem;
}

.connection-request-project {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.connection-request-status {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 850;
}

.connection-request-status.pending {
  color: #805d05;
  background: rgba(218, 166, 25, 0.13);
}

.connection-request-status.converted,
.connection-request-status.accepted {
  color: #17684e;
  background: rgba(23, 104, 78, 0.1);
}

.connection-request-status.declined,
.connection-request-status.cancelled,
.connection-request-status.expired {
  color: #a12d2d;
  background: rgba(190, 50, 50, 0.1);
}

.connection-request-message {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  color: #3f485d;
  background: rgba(247, 248, 255, 0.96);
  line-height: 1.6;
  white-space: pre-line;
}

.connection-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  color: var(--muted);
  font-size: 0.84rem;
}

.connection-request-response {
  margin: 0;
  padding: 13px 14px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.06);
  line-height: 1.55;
  white-space: pre-line;
}

.connection-request-response-form {
  display: grid;
  gap: 12px;
}

.connection-request-response-form label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

.connection-request-response-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  resize: vertical;
}

.connection-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.connection-request-decline {
  color: #a43c48;
  border-color: rgba(164, 60, 72, 0.28);
  background: rgba(164, 60, 72, 0.04);
}

@media (max-width: 680px) {
  .connection-requests-head,
  .connection-request-card-head {
    flex-direction: column;
  }

  .connection-requests-head-actions,
  .connection-request-actions {
    width: 100%;
  }

  .connection-requests-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-requests-head-actions .button,
  .connection-request-actions .button {
    width: 100%;
  }
}


/* HISTORIQUE DES MISES EN RELATION */

.connection-request-group {
  display: grid;
  gap: 14px;
}

.connection-request-group-head,
.connection-request-history-section > summary,
.connection-request-history-item > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.connection-request-group-head span,
.connection-request-history-section > summary span > span {
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.connection-request-group-head h5 {
  margin: 5px 0 0;
  font-size: 1.08rem;
}

.connection-request-group-head > b,
.connection-request-history-section > summary > b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
  font-size: 0.8rem;
}

.connection-request-pending-list,
.connection-request-history-list {
  display: grid;
  gap: 14px;
}

.connection-request-history-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(25, 45, 75, 0.12);
}

.connection-request-history-section > summary {
  cursor: pointer;
  list-style: none;
}

.connection-request-history-section
> summary::-webkit-details-marker,
.connection-request-history-item
> summary::-webkit-details-marker {
  display: none;
}

.connection-request-history-section
> summary strong {
  display: block;
  margin-top: 5px;
}

.connection-request-history-list {
  margin-top: 14px;
}

.connection-request-history-item {
  border: 1px solid rgba(25, 45, 75, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.connection-request-history-item > summary {
  cursor: pointer;
  padding: 15px;
}

.connection-request-history-main {
  min-width: 0;
}

.connection-request-history-main strong {
  display: block;
  line-height: 1.4;
}

.connection-request-history-main small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.connection-request-history-content {
  padding: 0 15px 15px;
}

.connection-request-history-content
.connection-request-card {
  border: 0;
  padding: 0;
  background: transparent;
}

@media (max-width: 680px) {
  .connection-request-group-head,
  .connection-request-history-section > summary,
  .connection-request-history-item > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-request-group-head > b,
  .connection-request-history-section > summary > b {
    align-self: flex-start;
  }
}
