/* Namespace: .pcg (Profilio Cyberspace Groups) */
.pcg { font-family: inherit; color: #0f172a; }
.pcg * { box-sizing: border-box; }

.pcg-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  padding:16px;
}

.pcg-head{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
}

.pcg-titleRow{
  display:flex;
  align-items:center;
  gap:10px;
  position:relative;
}

.pcg-title{
  margin:0;
  font-size:16px;
  font-weight:600;
  color:#111827;
  line-height:1.2;
}

.pcg-metric{
  margin-top:2px;
  font-size:12px;
  color:#6b7280;
}

.pcg-infoBtn{
  width:20px; height:20px;
  border-radius:999px;
  border:0;
  background: rgba(15, 23, 42, .85);
  color:#fff;
  font-size:12px;
  line-height:20px;
  cursor:pointer;
}

.pcg-tooltip{
  position:absolute;
  right:0;
  bottom:calc(100% + 8px);
  width:260px;
  background:#000;
  color:#f8fafc;
  border-radius:16px;
  padding:12px;
  font-size:11px;
  line-height:1.35;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  z-index:50;
}

.pcg-controls{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.pcg-searchWrap{
  position:relative;
  min-width:220px;
}

.pcg-searchIcon{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  font-size:14px;
  color:#9ca3af;
  pointer-events:none;
}

.pcg-input, .pcg-select{
  height:40px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-size:14px;
  color:#111827;
  outline:none;
}

.pcg-input{
  width:100%;
  padding:0 12px 0 34px;
}
.pcg-input::placeholder{ color:#9ca3af; }

.pcg-select{
  padding:0 38px 0 12px;
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #111827 50%),
    linear-gradient(135deg, #111827 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}

.pcg-input:focus, .pcg-select:focus{
  border-color:#2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.35);
}

.pcg-viewToggle{
  display:flex;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}

.pcg-viewBtn{
  width:40px; height:40px;
  border:0;
  background:#fff;
  cursor:pointer;
  color:#111827;
}
.pcg-viewBtn:hover{ background:#f9fafb; }
.pcg-viewBtn.is-active{ background:#f3f4f6; }

.pcg-body{ margin-top:14px; }

.pcg-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width: 680px){
  .pcg-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px){
  .pcg-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pcg-groupCard{
  border:1px solid #e5e7eb;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  min-height: 280px;
}

.pcg-cover{
  height:128px;
  background:#e5e7eb;
  position:relative;
  overflow:hidden;
}
.pcg-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.pcg-gAvatar{
  position:absolute;
  left:12px;
  top:12px;
  width:64px; height:64px;
  border-radius:18px;
  background:#fff;
  overflow:hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  border:4px solid #fff; /* ring */
}
.pcg-gAvatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.pcg-gContent{
  padding:12px 12px 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
  flex:1;
}

.pcg-gTitle{
  margin:0;
  font-size:15px;
  font-weight:600;
  color:#111827;
  line-height:1.25;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height: 38px;
}

.pcg-gMeta{
  font-size:13px;
  color:#6b7280;
}

.pcg-gFoot{
  padding:10px 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pcg-members{
  display:flex;
  align-items:center;
}
.pcg-member{
  width:28px; height:28px;
  border-radius:999px;
  overflow:hidden;
  border:2px solid #fff; /* ring */
  background:#e5e7eb;
  margin-left:-8px;
}
.pcg-member:first-child{ margin-left:0; }
.pcg-member img{ width:100%; height:100%; object-fit:cover; display:block; }
.pcg-memberMore{
  width:28px; height:28px;
  border-radius:999px;
  border:2px solid #fff;
  background:#f3f4f6;
  color:#6b7280;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-left:-8px;
}

.pcg-role{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#f3f4f6;
  color:#111827;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}
.pcg-role:before{
  content:"✓";
  font-weight:700;
}

/* LIST VIEW */
.pcg-list{
  border:1px solid #e5e7eb;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}

.pcg-row{
  display:flex;
  gap:12px;
  padding:12px;
  align-items:flex-start;
  justify-content:space-between;
  text-decoration:none;
  color:inherit;
}
.pcg-row + .pcg-row{ border-top:1px solid #eef2f7; }

.pcg-rowLeft{
  display:flex;
  gap:12px;
  min-width:0;
  flex:1;
}
.pcg-rowAvatar{
  width:46px; height:46px;
  border-radius:14px;
  overflow:hidden;
  background:#e5e7eb;
  flex:0 0 auto;
}
.pcg-rowAvatar img{ width:100%; height:100%; object-fit:cover; display:block; }

.pcg-rowMain{ min-width:0; flex:1; }
.pcg-rowTitle{
  margin:0;
  font-size:14px;
  font-weight:600;
  color:#111827;
  line-height:1.25;
}
.pcg-rowMeta{
  margin-top:3px;
  font-size:13px;
  color:#6b7280;
}
.pcg-rowDesc{
  margin-top:6px;
  font-size:13px;
  color:#374151;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.pcg-rowDesc.is-open{
  -webkit-line-clamp:unset;
  overflow:visible;
}
.pcg-rowDescToggle{
  margin-top:6px;
  font-size:13px;
  color:#7c3aed;
  background:transparent;
  border:0;
  padding:0;
  cursor:pointer;
}

.pcg-rowRight{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}
@media (max-width: 520px){
  .pcg-row{ flex-direction:column; }
  .pcg-rowRight{ width:100%; justify-content:flex-end; }
}

/* FOOTER */
.pcg-footer{
  margin-top:12px;
  display:flex;
  justify-content:center;
ோம்
}
.pcg-moreBtn{
  height:40px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  padding:0 16px;
  font-size:14px;
  font-weight:600;
  color:#111827;
  cursor:pointer;
}
.pcg-moreBtn:hover{ background:#f9fafb; }
.pcg-moreBtn:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.35);
}

/* STATES */
.pcg-empty{
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#fff;
  overflow:hidden;
  display:flex;
  align-items:stretch;
}
.pcg-emptyBar{
  width:40px;
  background:#6d28d9;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:700;
}
.pcg-emptyText{
  padding:12px;
  font-size:14px;
  color:#374151;
}

.pcg-error{
  border:1px solid #fecaca;
  background:#fef2f2;
  border-radius:16px;
  padding:12px;
  color:#991b1b;
  font-size:14px;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.pcg-error:before{ content:"⚠"; }

.pcg-skelGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}
@media (min-width: 680px){
  .pcg-skelGrid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (min-width: 1024px){
  .pcg-skelGrid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
.pcg-skelCard{
  border:1px solid #e5e7eb;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}
.pcg-skelTop{ height:128px; background:#f3f4f6; }
.pcg-skelBody{ padding:12px; }
.pcg-skelLine{
  height:12px;
  border-radius:999px;
  background:#f3f4f6;
  margin-top:10px;
}
.pcg-skelLine:first-child{ margin-top:0; width:75%; }
.pcg-skelLine:nth-child(2){ width:95%; }
.pcg-skelLine:nth-child(3){ width:55%; }

@media (prefers-reduced-motion: no-preference){
  .pcg-skelTop, .pcg-skelLine{
    animation: pcgPulse 1.2s ease-in-out infinite;
  }
  @keyframes pcgPulse{
    0%{ opacity: .55; }
    50%{ opacity: 1; }
    100%{ opacity: .55; }
  }
}

/* Defensive styling if select2 / bootstrap się podpina: staramy się utrzymać spójność w obrębie sekcji */
.pcg .select2-container { min-width: 200px; }
.pcg .select2-container .select2-selection--single{
  height:40px !important;
  border-radius:10px !important;
  border:1px solid #e5e7eb !important;
}
.pcg .select2-container .select2-selection--single .select2-selection__rendered{
  line-height:40px !important;
  font-size:14px !important;
  color:#111827 !important;
  padding-left:12px !important;
}
.pcg .select2-container .select2-selection--single .select2-selection__arrow{
  height:40px !important;
}
