/* Collaboration hub */

.collab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.collab-tab {
  border: 1px solid rgba(16, 37, 26, 0.14);
  background: #fff;
  color: #3a5646;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.collab-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 154, 99, 0.45);
}

.collab-tab.is-active {
  background: #2f855a;
  border-color: #2f855a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 133, 90, 0.25);
}

.collab-panel[hidden] {
  display: none !important;
}

.collab-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  align-items: start;
}

.collab-card {
  background: #fff;
  border: 1px solid rgba(16, 37, 26, 0.1);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.collab-card h2 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: #0b2417;
}

.collab-form {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.collab-form input,
.collab-form select,
.collab-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(16, 37, 26, 0.14);
  font: inherit;
  background: #fff;
}

.collab-form textarea {
  min-height: 4rem;
  resize: vertical;
}

.collab-form button,
.collab-btn {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: #2f855a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.collab-btn-ghost {
  background: transparent;
  color: #2f855a;
  border: 1px solid rgba(47, 133, 90, 0.35);
}

.collab-btn-danger {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid rgba(197, 48, 48, 0.25);
}

.collab-list {
  display: grid;
  gap: 0.5rem;
}

.collab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f4faf6;
}

.collab-row strong {
  display: block;
  color: #0b2417;
}

.collab-row span {
  display: block;
  font-size: 0.84rem;
  color: #6d8577;
}

.collab-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.collab-chat-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 0.75rem;
  min-height: 420px;
}

.collab-chat-list {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  max-height: 480px;
  overflow: auto;
}

.collab-chat-item {
  text-align: left;
  border: 0;
  background: #f4faf6;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.collab-chat-item.is-active {
  background: #e0f0e6;
  box-shadow: inset 3px 0 0 #2f855a;
}

.collab-chat-item strong {
  display: block;
  font-size: 0.92rem;
  color: #0b2417;
}

.collab-chat-item span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #6d8577;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collab-chat-thread {
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid rgba(16, 37, 26, 0.1);
  border-radius: 14px;
  min-height: 420px;
  background: #fafdfb;
}

.collab-messages {
  padding: 0.9rem;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.collab-msg {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(16, 37, 26, 0.08);
}

.collab-msg.mine {
  justify-self: end;
  background: #e8f5ee;
  border-color: rgba(47, 133, 90, 0.2);
}

.collab-msg .who {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2f855a;
  margin-bottom: 0.15rem;
}

.collab-msg p {
  margin: 0;
  white-space: pre-wrap;
  color: #0b2417;
  font-size: 0.92rem;
}

.collab-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid rgba(16, 37, 26, 0.08);
  background: #fff;
  border-radius: 0 0 14px 14px;
}

.collab-compose input {
  border: 1px solid rgba(16, 37, 26, 0.14);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font: inherit;
}

.collab-empty {
  padding: 1.25rem;
  text-align: center;
  color: #6d8577;
}

@media (max-width: 820px) {
  .collab-grid,
  .collab-chat-layout {
    grid-template-columns: 1fr;
  }
}
