/* مجتمع الطيبات — واجهة تفاعلية */
.comm-hub {
  --comm-radius: 14px;
  --comm-shadow: 0 8px 28px rgba(15, 61, 46, 0.08);
}
.comm-hub__hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.comm-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(45, 106, 79, 0.15);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark, #1a4d3a);
}
.comm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.comm-tabs__btn {
  border: 1px solid rgba(45, 106, 79, 0.2);
  background: #fff;
  color: var(--text, #1e293b);
  padding: 10px 16px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.comm-tabs__btn:hover {
  border-color: var(--accent, #2d6a4f);
}
.comm-tabs__btn.is-active {
  background: var(--accent, #2d6a4f);
  color: #fff;
  border-color: var(--accent, #2d6a4f);
}
.comm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.comm-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.comm-sort label {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}
.comm-sort select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(45, 106, 79, 0.25);
  font: inherit;
  background: #fff;
}
.comm-panel[hidden] {
  display: none !important;
}
.comm-q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.comm-q-card {
  background: #fff;
  border-radius: var(--comm-radius);
  box-shadow: var(--comm-shadow);
  border: 1px solid rgba(45, 106, 79, 0.1);
  padding: 18px 20px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.comm-q-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 61, 46, 0.12);
}
.comm-q-card__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.comm-q-card__title a {
  color: var(--primary-dark, #1a4d3a);
  text-decoration: none;
}
.comm-q-card__title a:hover {
  text-decoration: underline;
}
.comm-q-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}
.comm-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.1);
  color: var(--accent, #2d6a4f);
  font-size: 0.78rem;
  font-weight: 600;
}
.comm-q-card__excerpt {
  margin: 0;
  color: var(--text, #334155);
  line-height: 1.65;
}
.comm-q-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.comm-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(45, 106, 79, 0.2);
  background: #f8faf9;
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.comm-vote-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.comm-vote-btn.is-voted {
  background: rgba(45, 106, 79, 0.12);
  border-color: var(--accent, #2d6a4f);
}
.comm-enc-wall {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.comm-enc-card {
  background: linear-gradient(145deg, #f0fdf4 0%, #fff 60%);
  border: 1px solid rgba(45, 106, 79, 0.12);
  border-radius: var(--comm-radius);
  padding: 16px;
  position: relative;
}
.comm-enc-card__body {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.55;
}
.comm-members {
  display: grid;
  gap: 10px;
}
.comm-member-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--comm-radius);
  border: 1px solid rgba(45, 106, 79, 0.1);
}
.comm-member-row__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(45, 106, 79, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent, #2d6a4f);
  overflow: hidden;
}
.comm-member-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comm-journey-card {
  background: #fff;
  border-radius: var(--comm-radius);
  padding: 16px 18px;
  border-right: 4px solid var(--accent, #2d6a4f);
  box-shadow: var(--comm-shadow);
}
.comm-profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.comm-profile-stat {
  text-align: center;
  padding: 16px;
  background: #fff;
  border-radius: var(--comm-radius);
  border: 1px solid rgba(45, 106, 79, 0.12);
}
.comm-profile-stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--accent, #2d6a4f);
}
.comm-loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted, #64748b);
}
.comm-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted, #64748b);
}
.comm-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.comm-modal[hidden] {
  display: none !important;
}
.comm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.comm-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.comm-modal__close {
  position: absolute;
  top: 12px;
  left: 12px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}
.comm-form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.9rem;
}
.comm-form input,
.comm-form textarea,
.comm-form select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 106, 79, 0.25);
  border-radius: 10px;
  font: inherit;
}
.comm-form__msg {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
}
.comm-form__msg.is-ok {
  background: #ecfdf5;
  color: #166534;
}
.comm-form__msg.is-err {
  background: #fef2f2;
  color: #991b1b;
}
.comm-form__hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.comm-q-detail .comm-answer {
  background: #fff;
  border-radius: var(--comm-radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid rgba(45, 106, 79, 0.1);
}
.comm-q-detail .comm-answer.is-accepted {
  border-color: var(--accent, #2d6a4f);
  background: #f0fdf4;
}
@media (max-width: 640px) {
  .comm-tabs__btn {
    padding: 8px 12px;
    font-size: 0.88rem;
  }
}
