/* glulando — Admin Home Communities Panel v1.6 */

/* Panel — fixed rechts, unter Header */
#ah-community-panel {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    right: 0;
    top: 56px;
    bottom: 0;
    z-index: 50;
}
.dark #ah-community-panel { background: #0d1321; border-left: 1px solid rgba(255,255,255,0.06); }
body:not(.dark) #ah-community-panel { background: #f8fafc; border-left: 1px solid #e2e8f0; }

/* Elemente im Panel */
.ahc-header { display:flex;align-items:center;justify-content:space-between;padding:12px 14px;flex-shrink:0; }
.dark .ahc-header { border-bottom:1px solid rgba(255,255,255,0.06); }
body:not(.dark) .ahc-header { border-bottom:1px solid #e2e8f0; }
.ahc-title { font-weight:700;font-size:15px; }
.dark .ahc-title { color:#e2e8f0; }
body:not(.dark) .ahc-title { color:#1e293b; }

/* + Add Button */
.ahc-add-btn {
    width:30px;height:30px;border-radius:50%;border:none;font-size:18px;font-weight:700;
    cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:transform .15s, opacity .15s;
    -webkit-tap-highlight-color:transparent;
    line-height:1;
}
.ahc-add-btn:hover { transform:scale(1.1); }
.ahc-add-btn:active { transform:scale(.92); opacity:.85; }
.dark .ahc-add-btn { background:#22c55e;color:#fff; }
body:not(.dark) .ahc-add-btn { background:#6366f1;color:#fff; }

.ahc-list { flex:1;overflow-y:auto;padding:6px 8px; }
.ahc-item { display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:10px;cursor:pointer;margin-bottom:2px;border:1px solid transparent;transition:all .15s;position:relative; }
.dark .ahc-item:hover { background:rgba(255,255,255,0.04); }
body:not(.dark) .ahc-item:hover { background:#f1f5f9; }
.ahc-item.active { border-color:var(--ahc-color,rgba(255,255,255,0.15)); }
.dark .ahc-item.active { background:var(--ahc-bg,rgba(255,255,255,0.06)); }
body:not(.dark) .ahc-item.active { background:var(--ahc-bg,rgba(99,102,241,0.06)); }

.ahc-edit-btn { position:absolute;top:6px;right:6px;width:24px;height:24px;border-radius:6px;border:none;font-size:12px;cursor:pointer;opacity:0;transition:opacity .15s;display:flex;align-items:center;justify-content:center; }
.ahc-item:hover .ahc-edit-btn { opacity:1; }
.dark .ahc-edit-btn { background:rgba(255,255,255,0.1);color:#94a3b8; }
body:not(.dark) .ahc-edit-btn { background:#e2e8f0;color:#64748b; }

.ahc-avatar { width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;transition:border-radius .2s; }
.ahc-item.active .ahc-avatar { border-radius:12px;box-shadow:0 0 0 2px var(--ahc-color,rgba(255,255,255,0.2)); }
.ahc-avatar img { width:100%;height:100%;border-radius:inherit;object-fit:cover; }

.ahc-name { font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.dark .ahc-item.active .ahc-name { color:#e2e8f0; }
.dark .ahc-item:not(.active) .ahc-name { color:#94a3b8; }
body:not(.dark) .ahc-item.active .ahc-name { color:#1e293b; }
body:not(.dark) .ahc-item:not(.active) .ahc-name { color:#475569; }
.ahc-meta { font-size:11px;margin-top:2px; }
.dark .ahc-meta { color:#64748b; }
body:not(.dark) .ahc-meta { color:#94a3b8; }
.ahc-colors { display:flex;gap:3px;margin-top:3px; }
.ahc-dot { width:8px;height:8px;border-radius:4px; }
.ahc-active-dot { width:7px;height:7px;border-radius:4px;flex-shrink:0; }

.ahc-context-badge { display:inline-flex;align-items:center;gap:6px;border-radius:20px;padding:4px 12px;font-size:12px;font-weight:600;margin-bottom:10px; }

.ahc-footer { padding:10px 14px;flex-shrink:0; }
.dark .ahc-footer { border-top:1px solid rgba(255,255,255,0.06); }
body:not(.dark) .ahc-footer { border-top:1px solid #e2e8f0; }
.ahc-stats-card { border-radius:10px;padding:10px; }
.dark .ahc-stats-card { background:rgba(255,255,255,0.04); }
body:not(.dark) .ahc-stats-card { background:#f1f5f9; }
.ahc-stats-label { font-size:11px;font-weight:600;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.dark .ahc-stats-label { color:#94a3b8; }
body:not(.dark) .ahc-stats-label { color:#64748b; }
.ahc-stats-grid { display:flex;gap:14px; }
.ahc-stat-val { font-size:14px;font-weight:700; }
.dark .ahc-stat-val { color:#e2e8f0; }
body:not(.dark) .ahc-stat-val { color:#1e293b; }
.ahc-stat-lbl { font-size:10px; }
.dark .ahc-stat-lbl { color:#64748b; }
body:not(.dark) .ahc-stat-lbl { color:#94a3b8; }

.ahc-error { padding:10px;text-align:center;font-size:11px;border-radius:8px;margin:6px 8px; }
.dark .ahc-error { background:rgba(239,68,68,0.1);color:#f87171; }
body:not(.dark) .ahc-error { background:#fef2f2;color:#ef4444; }

body:not(.ah-active) #ah-community-panel { display:none !important; }
@media(max-width:768px) { #ah-community-panel { display:none !important; } }
