body.page-profile {
    background: #f8fafc;
}

 .profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.profile-shell {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform-origin: top right;
    transform: translateY(-6px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.profile-root {
    position: absolute;
    top: var(--profile-trigger-top, 72px);
    right: var(--profile-trigger-right, 16px);
    z-index: 10001;
}

.profile-shell.dropdown {
    align-items: stretch;
}

.profile-overlay.show .profile-shell {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.profile-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(15, 23, 42, 0.08);
    position: relative;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-card.compact {
    width: 320px;
    max-width: 92vw;
    max-height: 72vh;
    aspect-ratio: 3 / 4;
    overflow: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
}

.profile-card.compact::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 32px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    transform: rotate(45deg);
}

.profile-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.profile-username {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: #0f172a;
}

.profile-subtext {
    color: #64748b;
    font-size: 0.78rem;
    opacity: 0.8;
}

.profile-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.badge-item {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(0);
    transition: transform 0.2s ease;
}

.badge-item:hover {
    transform: translateY(-2px);
}

.badge-item i { font-size: 0.75rem; }

.badge-item.legend { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.badge-item.epic { background: linear-gradient(135deg, #64748b, #94a3b8); }
.badge-item.rare { background: linear-gradient(135deg, #10b981, #34d399); }

.border-dynamic {
    transition: box-shadow 0.3s ease;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.profile-info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #f8fafc;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-label {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    text-align: left;
    max-width: 100%;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.profile-actions.compact-actions {
    margin-top: 12px;
}

.profile-btn {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-btn.primary {
    background: #1d8d27;
    color: #fff;
    box-shadow: 0 10px 18px rgba(29, 141, 39, 0.24);
}

.profile-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 22px rgba(29, 141, 39, 0.3);
}

.profile-activity-card {
    padding: 0;
}

.profile-section-header {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.profile-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-notif-toggle {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-activity-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-card.compact .profile-activity-list {
    max-height: 220px;
    overflow: auto;
}

.profile-activity-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #ffffff;
}

.profile-activity-row:last-child {
    border-bottom: none;
}

.profile-activity-empty {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
}


@keyframes profileFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .profile-overlay {
        padding-top: 64px;
    }

    .profile-card {
        padding: 14px;
    }

    .profile-card.compact {
        aspect-ratio: auto;
        max-height: 80vh;
    }

    .profile-info-grid,
    .profile-activity-list {
        grid-template-columns: 1fr;
    }

    .profile-info-row,
    .profile-activity-row {
        padding: 8px 10px;
    }

    .profile-value {
        text-align: left;
        font-size: 0.84rem;
    }

    .profile-label {
        font-size: 0.7rem;
    }

    .profile-section-header {
        margin-bottom: 4px;
    }

    .profile-username {
        font-size: 1.05rem;
    }
}

.profile-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.profile-notif-card {
    padding: 0;
}

.profile-notif-list {
    display: grid;
    gap: 6px;
    max-height: 220px;
    opacity: 1;
}

.profile-notif-list.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.profile-notif-list {
    transition: max-height 0.25s ease, opacity 0.25s ease;
}

.profile-notif-more {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-notif-more:hover {
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.profile-notif-item {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.profile-notif-item.unread {
    border-color: rgba(34, 197, 94, 0.4);
    background: #ecfdf5;
}

.profile-notif-message {
    font-size: 0.78rem;
    color: #0f172a;
    position: relative;
    padding-right: 14px;
}

.profile-notif-time {
    margin-top: 4px;
    font-size: 0.66rem;
    color: #64748b;
}

.profile-notif-dot {
    position: absolute;
    right: 0;
    top: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.profile-notif-empty {
    font-size: 0.85rem;
    color: #94a3b8;
}
/* --- Digital Membership Card (Point 4) --- */
.profile-digital-card-container {
    margin: 12px 0;
    perspective: 1000px;
}

.digital-membership-card {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    border-radius: 16px;
    padding: 20px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.digital-membership-card:hover {
    transform: translateY(-5px) rotateX(2deg) rotateY(-2deg);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: cardGlowMove 10s infinite linear;
}

@keyframes cardGlowMove {
    0% { transform: translate(-10%, -10%); }
    50% { transform: translate(10%, 10%); }
    100% { transform: translate(-10%, -10%); }
}

.card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.card-brand img {
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.card-brand span {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-user-info {
    flex: 1;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.card-pimpinan {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
}

.card-role {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 800;
    margin-top: 12px;
    backdrop-filter: blur(4px);
}

.card-qr-section {
    background: #ffffff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card-qr-code img {
    display: block;
}

.card-footer {
    margin-top: 20px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    opacity: 0.4;
    text-align: center;
}

/* --- Biometric Section --- */
.profile-biometric-section {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 15px;
    border: 1px dashed #cbd5e1;
}

.biometric-info strong {
    display: block;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 4px;
}

.biometric-info p {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.btn-biometric, .profile-btn.secondary {
    width: 100%;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-biometric:hover, .profile-btn.secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-biometric i {
    color: #1d8d27;
}

/* Auth Pages Polish */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.divider span {
    padding: 0 10px;
}
