.profile-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

/* ── Profile Modal (popup) ─────────────────────────── */
.profile-modal-card {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 92%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 22px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    animation: profileModalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes profileModalPop {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: 0.18s;
}

.profile-modal-close:hover {
    background: rgba(244, 63, 94, 0.85);
    border-color: rgba(244, 63, 94, 0.9);
}

.profile-modal-close i {
    width: 17px;
    height: 17px;
}

/* edit-profile-modal must sit above the profile modal */
#edit-profile-modal {
    z-index: 11000;
}

/* Scrollbar inside profile modal */
.profile-modal-card::-webkit-scrollbar {
    width: 8px;
}
.profile-modal-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}
.profile-modal-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-card-main {
    padding: 0 !important;
    overflow: hidden;
    position: relative;
}

.profile-cover {
    height: 180px;
    position: relative;
    background: var(--bg-accent);
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-cover-btn,
.edit-avatar-btn {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.edit-cover-btn {
    bottom: 15px;
    right: 15px;
}

.profile-basic-info {
    padding: 0 30px 30px 30px;
    position: relative;
}

.profile-avatar-large {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 5px solid var(--bg-secondary);
    background: var(--bg-accent);
    position: relative;
    margin-top: -65px;
    margin-bottom: 15px;
    overflow: visible;
    isolation: isolate;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.edit-avatar-btn {
    bottom: 5px;
    right: 5px;
}

.profile-text-info h2 {
    font-size: 24px;
    font-weight: 800;
}

.profile-location {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.activity-icon {
    color: var(--color-primary);
}

.activity-detail p {
    font-size: 14px;
}

.activity-detail span {
    font-size: 11px;
    color: var(--text-dim);
}

.detail-row {
    margin-bottom: 20px;
}

.detail-row label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.detail-row span {
    font-weight: 500;
}

@media (max-width: 900px) {
    .profile-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Colleagues Grid */
.colleagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 16px;
    animation: fadeIn 0.4s ease;
}

.colleague-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    text-align: center;
    position: relative;
}

.colleague-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
}

.colleague-card-cover-clip {
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    height: 80px;
}

.colleague-card-cover {
    height: 100%;
    position: relative;
}

.colleague-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
}

/* Avatar wrapper — frame effects go here */
.colleague-card-avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: -36px auto 10px;
    z-index: 1;
    isolation: isolate;
}

.colleague-card-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.colleague-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Frame Animations ─────────────────────────── */
@keyframes frame-spin { to { transform: rotate(360deg); } }

@keyframes frame-glow-pulse {
    0%, 100% { box-shadow: 0 0 10px 4px rgba(0,194,146,0.7),   0 0 24px 8px  rgba(0,194,146,0.25); }
    50%       { box-shadow: 0 0 20px 8px rgba(0,194,146,0.95),  0 0 48px 16px rgba(0,194,146,0.45); }
}
@keyframes frame-glow-blue-pulse {
    0%, 100% { box-shadow: 0 0 10px 4px rgba(30,144,255,0.7),  0 0 24px 8px  rgba(30,144,255,0.25); }
    50%       { box-shadow: 0 0 20px 8px rgba(30,144,255,0.95), 0 0 48px 16px rgba(30,144,255,0.45); }
}
@keyframes frame-glow-purple-pulse {
    0%, 100% { box-shadow: 0 0 10px 4px rgba(150,50,255,0.7),  0 0 24px 8px  rgba(150,50,255,0.25); }
    50%       { box-shadow: 0 0 20px 8px rgba(150,50,255,0.95), 0 0 48px 16px rgba(150,50,255,0.45); }
}
@keyframes frame-glow-red-pulse {
    0%, 100% { box-shadow: 0 0 10px 4px rgba(255,50,50,0.7),   0 0 24px 8px  rgba(255,50,50,0.25); }
    50%       { box-shadow: 0 0 20px 8px rgba(255,50,50,0.95),  0 0 48px 16px rgba(255,50,50,0.45); }
}
@keyframes frame-neon-cycle {
    0%, 100% { box-shadow: 0 0 8px 3px #00ffff, 0 0 20px 8px rgba(0,255,255,0.35); }
    50%       { box-shadow: 0 0 8px 3px #ff00ff, 0 0 20px 8px rgba(255,0,255,0.35); }
}
@keyframes frame-neon-gold-cycle {
    0%, 100% { box-shadow: 0 0 8px 3px #ffd700, 0 0 20px 8px rgba(255,215,0,0.35); }
    50%       { box-shadow: 0 0 8px 3px #ff8c00, 0 0 20px 8px rgba(255,140,0,0.35); }
}
@keyframes frame-neon-lime-cycle {
    0%, 100% { box-shadow: 0 0 8px 3px #adff2f, 0 0 20px 8px rgba(173,255,47,0.35); }
    50%       { box-shadow: 0 0 8px 3px #00ff7f, 0 0 20px 8px rgba(0,255,127,0.35); }
}

/* Shared ::before setup for all spinning conic frames */
.colleague-card-avatar-wrap.frame-aurora::before,
.colleague-card-avatar-wrap.frame-aurora-sunset::before,
.colleague-card-avatar-wrap.frame-aurora-ocean::before,
.colleague-card-avatar-wrap.frame-fire::before,
.colleague-card-avatar-wrap.frame-fire-blue::before,
.colleague-card-avatar-wrap.frame-fire-gold::before,
.profile-avatar-large.frame-aurora::before,
.profile-avatar-large.frame-aurora-sunset::before,
.profile-avatar-large.frame-aurora-ocean::before,
.profile-avatar-large.frame-fire::before,
.profile-avatar-large.frame-fire-blue::before,
.profile-avatar-large.frame-fire-gold::before {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; z-index: -1;
}

/* Aurora variants */
.colleague-card-avatar-wrap.frame-aurora::before,
.profile-avatar-large.frame-aurora::before {
    background: conic-gradient(from 0deg, #ff0080, #ff8c00, #ffff00, #40e0d0, #7b68ee, #ff0080);
    animation: frame-spin 3s linear infinite;
}
.colleague-card-avatar-wrap.frame-aurora-sunset::before,
.profile-avatar-large.frame-aurora-sunset::before {
    background: conic-gradient(from 0deg, #ff1493, #ff6347, #ff8c00, #da70d6, #9932cc, #ff1493);
    animation: frame-spin 3s linear infinite;
}
.colleague-card-avatar-wrap.frame-aurora-ocean::before,
.profile-avatar-large.frame-aurora-ocean::before {
    background: conic-gradient(from 0deg, #00ffff, #1e90ff, #00bfff, #4169e1, #00ced1, #00ffff);
    animation: frame-spin 3s linear infinite;
}

/* Fire variants */
.colleague-card-avatar-wrap.frame-fire::before,
.profile-avatar-large.frame-fire::before {
    background: conic-gradient(from 0deg, #ff0000, #ff4500, #ff8c00, #ffcc00, #ff4500, #ff0000);
    animation: frame-spin 1.8s linear infinite;
}
.colleague-card-avatar-wrap.frame-fire-blue::before,
.profile-avatar-large.frame-fire-blue::before {
    background: conic-gradient(from 0deg, #00bfff, #1e90ff, #0040ff, #4080ff, #00bfff, #00bfff);
    animation: frame-spin 1.8s linear infinite;
}
.colleague-card-avatar-wrap.frame-fire-gold::before,
.profile-avatar-large.frame-fire-gold::before {
    background: conic-gradient(from 0deg, #ffd700, #ffa500, #ff8c00, #ffe066, #ffa500, #ffd700);
    animation: frame-spin 1.8s linear infinite;
}

/* Profile avatar: larger inset */
.profile-avatar-large.frame-aurora::before,
.profile-avatar-large.frame-aurora-sunset::before,
.profile-avatar-large.frame-aurora-ocean::before,
.profile-avatar-large.frame-fire::before,
.profile-avatar-large.frame-fire-blue::before,
.profile-avatar-large.frame-fire-gold::before { inset: -8px; }

/* Glow variants */
.colleague-card-avatar-wrap.frame-glow,
.profile-avatar-large.frame-glow { animation: frame-glow-pulse 2s ease-in-out infinite; }
.colleague-card-avatar-wrap.frame-glow-blue,
.profile-avatar-large.frame-glow-blue { animation: frame-glow-blue-pulse 2s ease-in-out infinite; }
.colleague-card-avatar-wrap.frame-glow-purple,
.profile-avatar-large.frame-glow-purple { animation: frame-glow-purple-pulse 2s ease-in-out infinite; }
.colleague-card-avatar-wrap.frame-glow-red,
.profile-avatar-large.frame-glow-red { animation: frame-glow-red-pulse 2s ease-in-out infinite; }

/* Neon variants */
.colleague-card-avatar-wrap.frame-neon,
.profile-avatar-large.frame-neon { animation: frame-neon-cycle 1.5s ease-in-out infinite; }
.colleague-card-avatar-wrap.frame-neon-gold,
.profile-avatar-large.frame-neon-gold { animation: frame-neon-gold-cycle 1.5s ease-in-out infinite; }
.colleague-card-avatar-wrap.frame-neon-lime,
.profile-avatar-large.frame-neon-lime { animation: frame-neon-lime-cycle 1.5s ease-in-out infinite; }

/* ── Frame Picker UI ──────────────────────────── */
.frame-picker { margin: 4px 0 14px; }

.frame-type-row, .frame-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.frame-color-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.frame-type-btn, .frame-pick-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 3px;
    cursor: pointer;
    transition: 0.2s;
    line-height: 0;
}

.frame-type-btn.active, .frame-pick-btn.active { border-color: rgba(255,255,255,0.5); }
.frame-type-btn:hover,  .frame-pick-btn:hover  { border-color: rgba(255,255,255,0.3); }

.frame-preview-circle { width: 30px; height: 30px; border-radius: 50%; }

.fpc-none          { background: var(--bg-accent); border: 2px solid rgba(255,255,255,0.15); }
.fpc-aurora        { background: conic-gradient(from 0deg, #ff0080, #ff8c00, #ffff00, #40e0d0, #7b68ee, #ff0080); }
.fpc-aurora-sunset { background: conic-gradient(from 0deg, #ff1493, #ff6347, #ff8c00, #da70d6, #9932cc, #ff1493); }
.fpc-aurora-ocean  { background: conic-gradient(from 0deg, #00ffff, #1e90ff, #00bfff, #4169e1, #00ced1, #00ffff); }
.fpc-fire          { background: conic-gradient(from 0deg, #ff0000, #ff4500, #ff8c00, #ffcc00, #ff4500, #ff0000); }
.fpc-fire-blue     { background: conic-gradient(from 0deg, #00bfff, #1e90ff, #0040ff, #4080ff, #00bfff, #00bfff); }
.fpc-fire-gold     { background: conic-gradient(from 0deg, #ffd700, #ffa500, #ff8c00, #ffe066, #ffa500, #ffd700); }
.fpc-glow          { background: var(--color-primary); box-shadow: 0 0 10px 4px rgba(0,194,146,0.7); }
.fpc-glow-blue     { background: #1e90ff; box-shadow: 0 0 10px 4px rgba(30,144,255,0.7); }
.fpc-glow-purple   { background: #9632ff; box-shadow: 0 0 10px 4px rgba(150,50,255,0.7); }
.fpc-glow-red      { background: #ff3232; box-shadow: 0 0 10px 4px rgba(255,50,50,0.7); }
.fpc-neon          { background: #0f172a; border: 2px solid #00ffff; box-shadow: 0 0 8px 3px #00ffff; }
.fpc-neon-gold     { background: #0f172a; border: 2px solid #ffd700; box-shadow: 0 0 8px 3px #ffd700; }
.fpc-neon-lime     { background: #0f172a; border: 2px solid #adff2f; box-shadow: 0 0 8px 3px #adff2f; }

.colleague-card-info {
    padding: 0 14px 18px;
}

.colleague-card-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.colleague-card-info p {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.colleague-role-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 194, 146, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(0, 194, 146, 0.2);
}

.colleague-role-tag.role-developer {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.25);
}

.colleague-role-tag.role-leader {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.25);
}

/* Colleague Profile Modal */
.colleague-modal-card {
    max-width: 380px;
    width: 90vw;
    padding: 0;
    overflow: hidden;
    position: relative;
    text-align: center;
    animation: slideUpFade 0.25s ease-out;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.colleague-modal-cover {
    height: 110px;
    background: linear-gradient(135deg, #00c292, #005f48);
    background-size: cover;
    background-position: center;
}

.colleague-modal-body {
    padding: 0 28px 28px;
}

/* Modal avatar with frame support */
.colleague-modal-avatar-wrap {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: -42px auto 14px;
    z-index: 1;
    isolation: isolate;
}

.colleague-modal-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--bg-secondary);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.colleague-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Frame effects on modal avatar */
.colleague-modal-avatar-wrap.frame-aurora::before,
.colleague-modal-avatar-wrap.frame-fire::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    z-index: -1;
}
.colleague-modal-avatar-wrap.frame-aurora::before {
    background: conic-gradient(from 0deg, #ff0080, #ff8c00, #ffff00, #40e0d0, #7b68ee, #ff0080);
    animation: frame-spin 3s linear infinite;
}
.colleague-modal-avatar-wrap.frame-fire::before {
    background: conic-gradient(from 0deg, #ff0000, #ff4500, #ff8c00, #ffcc00, #ff4500, #ff0000);
    animation: frame-spin 1.8s linear infinite;
}
.colleague-modal-avatar-wrap.frame-glow { animation: frame-glow-pulse 2s ease-in-out infinite; }
.colleague-modal-avatar-wrap.frame-neon { animation: frame-neon-cycle 1.5s ease-in-out infinite; }

/* Skeleton loading */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.cm-skel-cover {
    height: 110px;
    background: var(--bg-accent);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.cm-skel-body {
    padding: 0 28px 28px;
}

.cm-skel-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--bg-accent);
    margin: -42px auto 14px;
    border: 4px solid var(--bg-secondary);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.cm-skel-line {
    background: var(--bg-accent);
    border-radius: 6px;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
    display: block;
}


.colleague-modal-body h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.colleague-role-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    background: rgba(0, 194, 146, 0.12);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .colleagues-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .colleagues-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}